class id 直接style属性对div设置三者。
代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>div设后台色 宽度 高度 三种方式实例 CSS5</title>
<style>
.abc{ width:200px; height:100px; background:#F00}
#efg{ width:220px; height:80px; background:#333;color:#FFF}
</style>
</head>
<body>
<div class="abc">设置此DIV后台色彩红色 宽度200px高度100px </div>
<div id="efg">设置此DIV后盾色采 宽度220px 高度80px 字体颜色</div>
<div style=" bac千克round:#03F; width:180px; height:90px">后援蓝色 宽度 高度</div>
</body>
</html>
截图

涉猎器中测试成就
以上等于css配置配景致、css设置装备摆设div的背景物宽度高度。
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-jiaocheng/tc53634.shtml








