We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使元素既具有block的宽度高度特性又具有inline的同行特性。
我们可以一起来看一个demo:
<html> <style> * { padding: 0; margin: 0; } .a { display: inline; width: 100px; height: 100px; margin-top: 100px; margin-left: 100px; margin-right: 100px; margin-bottom: 100px; padding-left: 100px; padding-top: 100px; } .b { } .c { display: inline-block; width: 100px; height: 100px; background: blue; margin: 100px 100px; } </style> <div class="container"> <div class="a">a</div> <div class="a">a</div> <div class="a">a</div> <div class="a">a</div> <div class="b">b</div> <div class="b">b</div> <div class="b">b</div> <div class="c">c</div> <div class="c">c</div> <div class="c">c</div> </div> </html>
在这个demo中我们会看到的.a被设置为display:inline,其中width、height、margin-left、margin-right、padding-left、padding-right 都不起作用。其他的参照上面几点就比较清楚了。
.a
display:inline
The text was updated successfully, but these errors were encountered:
No branches or pull requests
display:block
display:inline
display:inline-block
使元素既具有block的宽度高度特性又具有inline的同行特性。
我们可以一起来看一个demo:
在这个demo中我们会看到的
.a
被设置为display:inline
,其中width、height、margin-left、margin-right、padding-left、padding-right 都不起作用。其他的参照上面几点就比较清楚了。参考文章
The text was updated successfully, but these errors were encountered: