DIV+CSS一个布局小问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 18:03:13
<table width="990" border="0" cellspacing="0" cellpadding="0" bgcolor="#de0505" height="5">
<tr>
<td></td>
</tr>
</table>
这是一个空表格,怎么用DIV+CSS布局出来?请把完整代码告诉我。
.xx {
background-color: #de0505;
height: 5px;
width: 990px;
}
这样出来的不5像素高

<style type="text/css">
#xx {
background-color:#de0505;
height: 5px;
width: 990px;
}
</style>

<div id="xx"></div>

修改如下:
<style type="text/css">
#xx {
background-color:#de0505;
height: 5px;
width: 990px;
overflow:hidden;
}
</style>

<div id="xx"></div>

加上overflow:hidden

或者:
<style type="text/css">
#xx {
background-color:#de0505;
height: 5px;
width: 990px;
line-height: 5px;
}
</style>

<div id="xx"></div>
加上文本高度的定义

这40分我要了
我对CSS 很在行

<style type="text/css">
<!--
.xx { /*定义类xx*/
background-color: #de0505;/*定义背景颜色*/
height: 5px; /*定义高度*/
overflow: hidden; /*