首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

html height,该怎么解决

2012-01-16 
html heightItemTemplatetr height 25td colspan 3span class text%# DataBinder.Eva

html height
<ItemTemplate>
  <tr height = "25">
  <td colspan = "3"><span class = "text">
  <%# DataBinder.Eval(Container.DataItem, "ProductID") %></span></td>
  <td colspan = "4"><span class = "text">
  <%# DataBinder.Eval(Container.DataItem, "ProductName") %></span></td>
  </tr>
  </ItemTemplate>

编译错误:Validation (XHTML 1.0 Transitional): Attribute 'height' is not a valid attribute of element 'tr'.
怎么解决啊,为什么编译有错也能运行?


[解决办法]
这不是编译错误,是html校验错误
[解决办法]
STYLE=“ height:25"
[解决办法]
HTML标准的问题,我习惯用style="width:25px"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[解决办法]
可以用,但是不标准.
[解决办法]
标准做法是在style里面设置的,这种写法不符合标准,不过在IE里面是兼容的
[解决办法]
由于你在html第一行添加了dtd验证文件
所以你写的这个属性不标准,验证不通过
修改如下:
<tr style="height:200;">

热点排行