日期:2014-05-17  浏览次数:20680 次

div+css布局————笔试题

div+css编写出实现如图所示页面效果的关键html代码。

其中,A、B、C、D、E均为默认字号和默认字体,并且加粗显示,它们都位于各自单元格的正中间,A单元格的高度为200像素,B单元格的高度为100像素,C单元格的宽度为100像素,高度为200像素。

 

 

<HTML>
<head>
</head>
<body>
<div style="width:300px; height:300px;">
<div align="center"  style="background-color:yellow;width:100px;height:200px; float: left; ">
<b>A</b></div>
<div align="center" style="background-color:red; width:200px;height:100px;float:left;"><b>B<b></div>
<div align="center" style="background-color:blue;width:100px;height:100px; float:left"><b>E</b></div>
<div align="center" style="background-color:pink;width:100px;height:200px;float:right;"><b>C</b></div>
<div align="center" style="background-color:red;width:200px;height:100px;float:left;"><b>D</b></div>
</div>
</body>
</html>

 

关键点:

css样式的float属性