Skip to content
New issue

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

去除Inline-block前面的空白符 #15

Open
AILINGANGEL opened this issue Jul 30, 2019 · 0 comments
Open

去除Inline-block前面的空白符 #15

AILINGANGEL opened this issue Jul 30, 2019 · 0 comments

Comments

@AILINGANGEL
Copy link
Owner

当一个inline-block和其他的内联元素并排显示时前面会有一个空白符,如下图所示
image

空白符引起的原因

在书写html的时候为了保证html格式会进行换行书写,这个空白符就是这个换行符

去掉这个空白符的方法

  1. 在父元素上设置font-size: 0; 这个空白符也属于字符,设置父元素的font-size:0就相当于去除了这个字符
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant