
最后,我不想设置第二个÷>的宽度。因为我需要标记以不同的宽度工作。
样品标记在http://jsfiddle.net/rhEyM/以下。
CSS
.left-div { float: left; wIDth: 100px; height: 20px; margin-right: 8px; background-color: linen;}.right-div { float: left; margin-left: 108px; background-color: skyblue;} HTML
<div > </div><div > My requirements are <b>[A]</b> Content in the two divs should line up at the top,<b>[B]</b> Long text in right-div should not wrap underneath left-div,and <b>[C]</b> I do not want to specify a wIDth of right-div. I don't want to set the wIDth of right-div because this markup needs to work within different wIDths.</div>解决方法 我从第二个div删除了浮动,使其工作。
http://jsfiddle.net/rhEyM/2/
总结以上是内存溢出为你收集整理的html – 并排显示两个全部内容,希望文章能够帮你解决html – 并排显示两个所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)