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

【CSS】题3. 行内元素和块级元素 #9

Open
Easay opened this issue Apr 1, 2021 · 0 comments
Open

【CSS】题3. 行内元素和块级元素 #9

Easay opened this issue Apr 1, 2021 · 0 comments
Labels

Comments

@Easay
Copy link
Owner

Easay commented Apr 1, 2021

行内元素(inline)

特点:

  • 高度、外边距、内边距不可改变;
  • 宽度就是内容(文字或图片)的高度,不可改变;
  • 无法设置宽度和高度,margin和padding只有左右有效。

块级元素(block)

特点:

  • 总是在新行上开始
  • 高度、行高以及内外边距都可以控制
  • 宽度缺省是容器的100%,除非设定宽度
  • 可以容纳内联元素和其他块元素

行内块级元素(inline-block)

将对象呈现为inline,让block元素不再独占一行,多个可以排成一行,并且具有block属性,可设置宽高、margin和padding。

@Easay Easay added the CSS label Apr 1, 2021
@Easay Easay pinned this issue Apr 1, 2021
@Easay Easay unpinned this issue Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant