Home > Web Front-end > HTML Tutorial > 为一组元素设置display:inline-block;后元素之间会增加空隙_html/css_WEB-ITnose

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

WBOY
Release: 2016-06-21 09:39:12
Original
1460 people have browsed it

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档





           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;
Copy after login

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template