请看代码
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns= "http://www.w3.org/1999/xhtml" ><head><meta http-equiv= "Content-Type" content= "text/html; charset=gb2312" /><title>无标题文档</title><style type= "text/css" >div{display:inline;width:100px;height:100px;padding:0;margin:0;float:left;}#div0{ width::400px;height:200px; background-color:black;display:block;float:none;}.div1{ background-color:red;}.div2{ background-color:blue;}.div3{ background-color:yellow;}</style></head><body><div id= "div0" > <div class = "div1" > 1</div> <div class = "div2" > 2</div> <div class = "div3" > 3</div></div></body></html>
|
Copier après la connexion
效果图:
按照css的定义,div1,div2,div3都应该横向排列才对呀?为什么呈现效果是纵向的?求教各位
回复讨论(解决方案)
晕!width后面多了个冒号!所以css没起作用
这就是Dreamweaver没有代码检查弊端啊,用VS一下子就看出来错误来了
我也看到了,#div0的样式那里width多了个冒号。
好吧,没人想接分吗?没有就都给楼上了