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
引用MDN上的解释:
块级元素占据其父元素(容器)的整个空间,因此创建了一个 “块“ 行内元素只占据它对应标签的边框所包含的空间
width/height
margin/padding
margin-left/margin-right/padding-left/padding-right
display display : none 不显示该元素,且不保留该元素原来占有的文档流位置 display : block 转换为块级元素 display : inline 转换为行内元素 display : inline-block 转换为行内块级元素,拥有块级元素的性质
float 当把行内元素设置为 float:left/right时,该行内元素的 display 属性会变为 block,且有浮动特性
float:left/right
position 当为行内元素进行定位时,position:absolute/fixed 都会使得行内元素变为块级元素
The text was updated successfully, but these errors were encountered:
No branches or pull requests
引用MDN上的解释:
块级元素和行内元素的区别:
width/height
。行内元素设置宽高无效margin/padding
;行内元素起边距作用的只有margin-left/margin-right/padding-left/padding-right
,其他的不起边距效果块级元素和行内元素的转换
display
display : none 不显示该元素,且不保留该元素原来占有的文档流位置
display : block 转换为块级元素
display : inline 转换为行内元素
display : inline-block 转换为行内块级元素,拥有块级元素的性质
float
当把行内元素设置为
float:left/right
时,该行内元素的 display 属性会变为 block,且有浮动特性position
当为行内元素进行定位时,position:absolute/fixed 都会使得行内元素变为块级元素
The text was updated successfully, but these errors were encountered: