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

企鹅博客
企鹅博客
企鹅博客
25193
文章
0
评论
2020年8月29日18:54:49 评论 26 views
 
 
 无标题文档 
  		
  
   

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;}


如图,粉红色与绿色的行高对不齐,请问如何才能自动对齐呢?

楼主参考下

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;这样垂直方向就不会被挤开。

继续阅读
企鹅博客
  • 本文由 发表于 2020年8月29日18:54:49
  • 转载请务必保留本文链接:https://www.qieseo.com/372763.html
css的一些小技巧!页面视觉差!_html/css_WEB-ITnose html教程

css的一些小技巧!页面视觉差!_html/css_WEB-ITnose

相当长的一段时间,现在网站与所谓的“视差”效果一直很受欢迎。 万一你没有听说过这种效果,不同的图像,在不同的方向移动或层主要包括。这导致了一个很好的光学效应,使参观者的注意。 在网页设计中,为了实现这...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: