您好,欢迎访问一九零五行业门户网

问下如何让两个浮动元素行高自动相等?_html/css_WEB-ITnose

无标题文档 w3school.com.cn
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
never increase, beyond what is necessary, the number of entities required to explain anything. william of ockham (1285-1349)
free web building tutorials w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
w3school.com.cn - the largest web developers site on the net!
copyright 2008 by yingke investment.

回复讨论(解决方案) @charset utf-8;/* css document */#header{ padding:0.5em;color:white;background-color:gray;clear:both;}#mainbox { width:1250px; margin:0 auto; border:5px; border:1px solid black;} #sidebar { float:left; padding:auto; width:445px; background:#f0f; height:170%; } #content { float: left; width:650px; padding:auto; background:#499; height:170%; }#footer{ padding:2.5em;color:white;background-color:gray;clear:both; text-align:center;}
[img=http://my.csdn.net/my/album/detail/1163464][/img]
如图,粉红色与绿色的行高对不齐,请问如何才能自动对齐呢?
[img=http://my.csdn.net/my/album/detail/1163464#][/img]
楼主参考下
http://www.blueidea.com/tech/web/2006/3210.asp
自己慢慢设置,设一个值调了看看、、不等在重新设
#sidebar { float:left; padding:auto; width:445px; background:#f0f; height:540px; overflow:hidden; }
#content { float: left; width:650px; padding:auto; background:#499; height:540px;overflow:hidden; }
改成这样试试一下,因为都是内部的div,不属于浮动层,div会随着数据的增加变高,很明显,你左右2部分的p标签不一样多,建议设置成固定值,然后overflow:hidden;这样垂直方向就不会被挤开。
其它类似信息

推荐信息