Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.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/7/css/40.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
Html 表元素上的标记无效_Html_Css_Html Table_Dreamweaver - Fatal编程技术网

Html 表元素上的标记无效

Html 表元素上的标记无效,html,css,html-table,dreamweaver,Html,Css,Html Table,Dreamweaver,我使用Dreamweaver创建了我的表,它为我创建了所有的高度和宽度,但是当我通过CSS验证程序时,我已经完成了 table元素的width属性已过时。改用CSS 元素上的bgcolor属性已过时。改用CSS th元素上的“高度”属性已过时。改用CSS 基本上,第th元素上的所有属性都表示它已过时 <table width="1108" border="1" id="table"> <tr id="t

我使用Dreamweaver创建了我的表,它为我创建了所有的高度和宽度,但是当我通过CSS验证程序时,我已经完成了

table元素的width属性已过时。改用CSS

元素上的bgcolor属性已过时。改用CSS

th元素上的“高度”属性已过时。改用CSS

基本上,第th元素上的所有属性都表示它已过时

<table width="1108" border="1" id="table">
   <tr id="toprow">
     <th width="103" height="45" bgcolor="#000000" scope="row">Name</th>
     <th width="114" bgcolor="#000000">Type </th>
     <th width="104" bgcolor="#000000">Summoner Level</th>
     <th width="191" bgcolor="#000000">Maps</th>
     <th width="566" bgcolor="#000000">Description</th>
   </tr>
 <tr>
     <th height="120" scope="row"><p><img src="summonerspells/64px-Barrier.png" width="64" height="64" alt="barrier"></p>
     <p>Barrier</p></th>
     <td>Defense</td>
     <td>Level 6</td>
     <td><p>Summoner's Rift<br>
Twisted Treeline<br>
Crystal Scar<br>
Howling Abyss</p></td>
     <td>Shields your champion for 115-455 (depending on champion level) for 2     seconds.</td>
   </tr>

<tr>
     <th height="68" scope="row"><p><img src="summonerspells/Teleport.png" width="64" height="64" alt="teleport"></p>
     <p>Teleport</p></th>
     <td>Utility</td>
     <td>Level 2 </td>
     <td>summoners rift</td>
     <td>After casting for 4 seconds, teleports your champion to target allied minion, turret, or ward.</td>
   </tr>
   <tr>
     <th height="68" scope="row"><p><img src="summonerspells/Clarity.png" width="64" height="64" alt="clarity"></p>
     <p>Clarity</p></th>
     <td>Utility</td>
     <td>Level 1</td>
     <td>Summoner's Rift<br>
       Twisted Treeline<br>
       Crystal Scar<br>
     Howling Abyss</td>
     <td>Restores 40% of your champion's maximum Mana. Also restores allies for 40% of their maximum Mana</td>
   </tr>
这是代码的一部分,我的表很长,所以读起来会很累。如果你知道如何解决高度问题,我可以用我的其他代码来解决

<style type="text/css">
    table {width:1108px;border:1px solid #999;}
    table tr#toprow th {height:120px;background-color:#000;}
</style>
您不需要在其他行上设置高度,因为您的图像将使用其图像高度将其拉伸

<table id="table">
   <tr id="toprow">
     <th>Name</th>
     <th>Type </th>
     <th>Summoner Level</th>
     <th>Maps</th>
     <th>Description</th>
   </tr>
 <tr>
     <th scope="row"><p><img src="summonerspells/64px-Barrier.png" width="64" height="64" alt="barrier"></p>
     <p>Barrier</p></th>
     <td>Defense</td>
     <td>Level 6</td>
     <td><p>Summoner's Rift<br>
Twisted Treeline<br>
Crystal Scar<br>
Howling Abyss</p></td>
     <td>Shields your champion for 115-455 (depending on champion level) for 2     seconds.</td>
   </tr>

<tr>
     <th scope="row"><p><img src="summonerspells/Teleport.png" width="64" height="64" alt="teleport"></p>
     <p>Teleport</p></th>
     <td>Utility</td>
     <td>Level 2 </td>
     <td>summoners rift</td>
     <td>After casting for 4 seconds, teleports your champion to target allied minion, turret, or ward.</td>
   </tr>
   <tr>
     <th scope="row"><p><img src="summonerspells/Clarity.png" width="64" height="64" alt="clarity"></p>
     <p>Clarity</p></th>
     <td>Utility</td>
     <td>Level 1</td>
     <td>Summoner's Rift<br>
       Twisted Treeline<br>
       Crystal Scar<br>
     Howling Abyss</td>
     <td>Restores 40% of your champion's maximum Mana. Also restores allies for 40% of their maximum Mana</td>
   </tr>

您一定使用过HTML5验证程序,即根据某些HTML5草案进行检查的实验软件,例如CSS验证程序不会发出有关HTML标记的消息

首先,你应该决定你是否在乎。像HTML5验证器抱怨的那些标记特性是过时的,而且通常很笨拙,但它们是有效的,HTML5草案包含了对浏览器的要求,以保持对它们的支持。用CSS替换它们在很大程度上是一个理论纯度的问题,您可能负担不起,尤其是如果您打算使用生成此标记的工具来维护页面。此外,任何代码清理都有可能导致问题而不是解决问题:您可能会出错,并且可能会无意中更改渲染

如果您真的想继续,您可以查看我的非正式页面,如果您有勇气,还可以查看HTML5 CR中的一节,该节更正式地描述了浏览器应该如何将表示HTML元素和属性映射到CSS

特别是,

width属性自然映射到同名的CSS属性,例如`table{width:1108px} bgcolor属性映射到background color属性 “高度”属性映射到具有相同名称的CSS属性。 一个简单的方法是用样式属性内的CSS代码替换属性,例如

<th style="width: 103px; height: 45px; background-color: #000000" 
    scope="row">Name</th>
这是否是一种进步值得怀疑。最好使用外部样式表并将规则放在那里。但是,您需要合适的选择器,为此,您需要对CSS基础知识有很好的理解


在实践中真的没有什么收获。“修复”由创作工具生成的HTML代码很无聊,容易出错,而且通常没有效率。相反,对于未来的项目,尝试寻找能够生成合理现代、可读且健壮的HTML和CSS代码的工具。

这就是使用编辑器所得到的。为什么不按照验证器的好建议使用CSS呢?我不知道如何使用CSS><我的意思是我知道,但我不熟悉表样式这是如何涉及jQuery的*删除标记*haha><我想我会在QN上画更多的ppl,因为jquery与html相关