当前位置:Gxlcms > html代码 > 为一组元素设置display:inline-block;后元素之间会增加空隙_html/css_WEB-ITnose

为一组元素设置display:inline-block;后元素之间会增加空隙_html/css_WEB-ITnose

时间:2021-07-01 10:21:17 帮助过:16人阅读





无标题文档





1star
2star
3star
4star
5star




我为.rating中的一组a元素设置display:inline-block;后发现每两个a中间有会空隙,但是将display:inline-block;换成display:block;float:left;后却是正常的(即中间没有空隙),这是为什么呢?求各位指点!先谢啦!


回复讨论(解决方案)

http://www.w3school.com.cn/htmldom/prop_style_display.asp
好好看一下,inline-block??
先弄懂每一个属性值是什么作用,然后再去用。。

参考下吧

http://www.zhangxinxu.com/wordpress/2012/04/inline-block-space-remove-%e5%8e%bb%e9%99%a4%e9%97%b4%e8%b7%9d/

有些还是不太清楚

display: inline; clear:both;

谢谢各位的解答,我觉得给的链接特别好!我以后一会多看看这个空间学习学习!

人气教程排行