Rumah > hujung hadapan web > html tutorial > 浏览器兼容问题:高度显示错误_html/css_WEB-ITnose

浏览器兼容问题:高度显示错误_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Lepaskan: 2016-06-24 12:07:16
asal
920 orang telah melayarinya

IE6和IE8显示正常,但是谷歌浏览器高度显示不正常。求解,代码如下:

<style>div,p,ul,li{margin:0; padding:0;}.ilistr{ width:340px; height:auto; float:right;}.ilcol{ width:338px; height:auto; margin-top:10px; border-bottom:1px solid #eaeaea; border-left:1px solid #eaeaea; border-right:1px solid #eaeaea; border-top:2px solid #ff6793; clear:both;}.ilcol_tit{ width:328px; height:30px; background-color:#fcfcfc; font-size:16px; font-weight:bold; line-height:30px; padding-left:10px;}.ilcol_tit a{ color:#00aaff;}.ilcol_tit a:hover{ color:#ff6793;}.ilcol_all{ width:338px; height:auto; clear:both;}.ilcol_all ul { width:330px; padding:5px 4px;}.ilcol_all ul li{ width:324px; padding-left:6px; border-bottom:1px dashed #d2d2d2; clear:both; list-style-type:none;}.ilcol_tita{ width:313px; padding-left:11px; height:30px; line-height:30px; font-size:14px; font-weight:bold; background: url(../images/listcol.gif) no-repeat 0px 5px;}.ilcol_tita a{ color:#00aaff;}.ilcol_tita a:hover{ color:#ff6793;}.ilcol_titb{ width:74px; height:25px; overflow:hidden; line-height:25px; float:left; padding-left:7px; background: url(../images/tag.gif) no-repeat 0px 7px;}</style><div class="ilcol"><div class="ilcol_tit"><a href="/">栏目导航</a></div><div class="ilcol_all"><ul><li><div class="ilcol_tita"><a href="/">大栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div></li><li><div class="ilcol_tita"><a href="/">大栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div><div class="ilcol_titb"><a href="/">小栏目标题</a></div></li></ul></div></div>
Salin selepas log masuk


回复讨论(解决方案)

应该是li标签不能自适应高度,用 overflow:auto 能解决,但是会有滚动条,太难看了。。 有高手吗?我是新手,第一次写门户站的代码,遇到好多问题

晕了,li加上overflow:hidden;直接就能解决

饿..多理解一下各种属性. 很快就好了

如果是Chrome浏览器, 直接F12呼出开发者模式, 可以在界面上调整元素属性, 来确定问题

Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan