Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML5表格样式,无需访问CSS文件_Html - Fatal编程技术网

HTML5表格样式,无需访问CSS文件

HTML5表格样式,无需访问CSS文件,html,Html,我正在尝试用HTML5重新创建这个表。它不必看起来像这样完美,只要够近就行了。我没有访问CSS文件的权限。感谢您对最佳实践的建议 多谢各位 使用标记在HTML中编写CSS,或使用(段落“内联样式”)选项: 三个选项,从最差到最佳: 使用内联样式手动设置所有HTML元素的样式,例如 <table style='width:80%;margin:auto;'> CSS样式表文件: #mytable tr td{ background-color:#ccc; } etc

我正在尝试用HTML5重新创建这个表。它不必看起来像这样完美,只要够近就行了。我没有访问CSS文件的权限。感谢您对最佳实践的建议

多谢各位

使用
标记在HTML中编写CSS,或使用(段落“内联样式”)

选项: 三个选项,从最差到最佳:

  • 使用内联样式手动设置所有HTML
    元素的样式,例如

     <table style='width:80%;margin:auto;'> 
    
    CSS样式表文件:

    #mytable tr td{
       background-color:#ccc;
       }
    etc. etc.
    
    HTML标题:

    <link rel="stylesheet" type="text/css" href="existingStyleSheet.css">
    <link rel="stylesheet" type="text/css" href="myTableStyle.css">
    
    上面的内容不能被任何内容覆盖,但是其他CSS规则可能会干扰,例如
    !重要的
    元素的边框声明可能会弄乱表格边框,等等


    你能使用内联CSS吗?也许你的意思是:你无法访问外部CSS文件。。。但是你可以使用内联样式吗?是的,对不起,我的意思是我没有访问CSS文件的权限--我可以使用内联样式。我没有访问页眉的权限。所以基本上我是从一个富文本框编辑HTML,它是CMS的一部分。(我应该提到)无论我做什么,CSS似乎都会覆盖内联样式。除此之外,我认为HTML5不支持border属性。从W3学校可以看到:CSS边框是完全支持的,HTML表格边框不是。虽然这两种都是解决方案,但不推荐使用。
    #mytable tr td{
       background-color:#ccc;
       }
    etc. etc.
    
    <link rel="stylesheet" type="text/css" href="existingStyleSheet.css">
    <link rel="stylesheet" type="text/css" href="myTableStyle.css">
    
    <table style='border: 1px solid #000 !important;'></table>