我有一个简单的HTML格式表>我希望表中的每个单元格都有自己的边框。我为它定义了一个CSS属性,如:
td {
width: 350px;
height: 50px;
border:thick;
border-color: black;
border-radius: 5px;
}
HTML:
< table border="0">
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
边框在“Dreamweaver设计模式”中可见,但是当文档在Firefox中运行时,边框消失。为什么会这样?
答案 0 :(得分:4)
试试这个: -
<table>
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
td{
width: 350px;
height: 50px;
border: thick solid black;
border-radius: 5px;
}
答案 1 :(得分:0)
在这种情况下,如果您在浏览器之间出现偏差,我总是建议您直接使用验证器!
当我把代码放进去时(把css放在头部的样式标签中)给我这些错误:
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8
="0">↩ <tr><td>Ro Error: Stray start tag td. From line 16, column 9; to line 16, column 12
>↩ <tr><td>Row1</ Error: Stray end tag td. From line 16, column 17; to line 16, column 21 r><td>Row1</td></tr> Error: Stray end tag tr. From line 16, column 22; to line 16, column 26
>Row1</td></tr> ↩ Error: Stray start tag tr. From line 17, column 5; to line 17, column 8 /tr> ↩ <tr><td>Ro Error: Stray start tag td. From line 17, column 9; to line 17, column 12 ↩ <tr><td>Row2</ Error: Stray end tag td. From line 17, column 17; to line 17, column 21 r><td>Row2</td></tr> Error: Stray end tag tr. From line 17, column 22; to line 17, column 26
>Row2</td></tr> ↩ Error: Stray start tag tr. From line 18, column 5; to line 18, column 8 r> ↩ <tr><td>Ro Error: Stray start tag td. From line 18, column 9; to line 18, column 12 ↩ <tr><td>Row3</ Error: Stray end tag td. From line 18, column 17; to line 18, column 21 r><td>Row3</td></tr>↩ Error: Stray end tag tr. From line 18, column 22; to line 18, column 26
>Row3</td></tr>↩</tab Error: Stray end tag table. From line 19, column 1; to line 19, column 8 /td></tr>↩</table>
最重要的是第一个条目:
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8