DIV+css的问题 <div id="div1" style="width:100%"> <div id="div2" style="width:100px;"></div> <div id="div3"></div></div>如何让div3的宽度刚好填满div1里剩下的部分,如果用auto的话在ie里可以,但在ff或谷歌里就不行了,只会根据内容宽度自动调整大小 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <div id="div1" style="width:100%; "> <div id="div2" style="width:100px; float:left;"></div> <div id="div3" style="margin-left:100px;"></div></div> <div id="div1" style="width:100%"> <div id="div2" style="width:100px; float:left"></div> <div id="div3" style="float:right"></div></div>应该兼容很多浏览器 <div id="div1" style="width:100%;background:red;height:50px;float:left"> <div id="div2" style="width:10%;background:blue;height:50px;float:left"></div> <div id="div3" style="width:90%;background:green;height:50px;float:left"></div></div>我建议楼主要么都用px为单位,要么都用%为单位,这样浏览器好识别;一会%一会px在不同的浏览器中展现,效果可能不一样。 试过了还是不行啊,主要是不管width设为auto还是不设,ff都不会像ie一样自动扩张剩下的宽度,而只会根据内容的宽度而自动适应内容 呵呵,试过了可以,只是我之前比你多写了个float:left,<div id="div3" style="margin-left:100px;float:left"></div>,为什么多了个float:left就不行了呢?楼下的请回答 文件下载 IE6无法直接打开 asp.net 求助啊! post提交,后台接收到的值不能给服务器控件赋值? asp.net(C#)在用bt2事件怎么调用bt1事件里面的数据 asp.net页面焦点的问题 门户网站首页的新闻列表怎么做呀~!!! DataView的模糊匹配 关于KindEditor 想取出表中编号最大的那个值 怎样SQL中取出一条纪录,并把该条纪录的字段作为一个变量来用(200分请教) 发个软件研究院的面试题目,100分占了20分:你经常上的技术网站和知道的.NET开源项目 页面上按下enter键怎么让光标自动移动到下控件上
<div id="div2" style="width:100px; float:left;"></div>
<div id="div3" style="margin-left:100px;"></div>
</div>
<div id="div2" style="width:100px; float:left"></div>
<div id="div3" style="float:right"></div>
</div>应该兼容很多浏览器
<div id="div2" style="width:10%;background:blue;height:50px;float:left"></div>
<div id="div3" style="width:90%;background:green;height:50px;float:left"></div>
</div>我建议楼主要么都用px为单位,要么都用%为单位,这样浏览器好识别;一会%一会px在不同的浏览器中展现,效果可能不一样。
呵呵,试过了可以,只是我之前比你多写了个float:left,<div id="div3" style="margin-left:100px;float:left"></div>,为什么多了个float:left就不行了呢?楼下的请回答