We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有没有发现,行内元素之间有一些空隙?
先举个栗子
<div> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> </div>
展示出来的结果,你发现1、2、3之间并未严格贴在一起,而是之间有一些间隙?
这就是行内元素之间默认的间隙!
本文简单的讲下出现这种问题的常见的场景!
如:a、span、img等
a
span
img
inline
inline-block
div{ display : inline;/* inline-block */ }
参考:https://css-tricks.com/fighting-the-space-between-inline-block-elements/
The text was updated successfully, but these errors were encountered:
sunmaobin
No branches or pull requests
有没有发现,行内元素之间有一些空隙?
一、行内元素之间的空隙
先举个栗子
展示出来的结果,你发现1、2、3之间并未严格贴在一起,而是之间有一些间隙?
这就是行内元素之间默认的间隙!
本文简单的讲下出现这种问题的常见的场景!
二、行内元素的形成
2.1 默认的行内元素存在间隙
如:
a
、span
、img
等2.2 强制将元素属性设置为
inline
或者inline-block
的三、空隙带来的负作用
四、常见的解决办法
参考:https://css-tricks.com/fighting-the-space-between-inline-block-elements/
The text was updated successfully, but these errors were encountered: