gpt4 book ai didi

html - 第二个、第三个等水平子弹 (LI) 被向下推

转载 作者:行者123 更新时间:2023-11-27 22:34:02 24 4
gpt4 key购买 nike

在这个页面上,我被要求查看(参见下面的链接),UL#columns 中的第二个和第三个 LI 被下推。

删除 default.css 第 61 行的 clear:both 修复了这个问题。但是,我不清楚为什么。有什么想法吗?

#columns {width: 960px; clear: both; margin-top: 90px;}
#columns li {width: 290px; float: left; display: inline-block; background-position: center top; background-repeat: no-repeat; text-align: center; margin-right: 40px; opacity: 0;}
#columns li:nth-child(3) {margin-right: 0;}
#columns li h3 {font-size: 22px; color #33343d; display: block; clear: both; margin-top: 50px;}
#columns li P {color: #78797d; font-size: 15px; margin-top: 10px;}

#columns li.heart {background-image: url('../img/icons/heart.gif');}
#columns li.phone {background-image: url('../img/icons/phone.gif');}
#columns li.wheel {background-image: url('../img/icons/wheel.gif');}

enter image description here

最佳答案

您正在使用 float:leftdisplay:inline-block,删除 float:left 并且它会正常工作!

除了使用 inline-block,您可以使用 float:leftclearfix,例如 this one !

要使 IE 与 inline-block 一起工作,请添加这些行:

*display : inline;
*zoom : 1;

关于html - 第二个、第三个等水平子弹 (LI) 被向下推,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15290253/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com