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

【Q339】伪类与伪元素有什么区别 #342

Open
shfshanyue opened this issue Jun 10, 2020 · 1 comment
Open

【Q339】伪类与伪元素有什么区别 #342

shfshanyue opened this issue Jun 10, 2020 · 1 comment
Labels

Comments

@shfshanyue
Copy link
Owner

No description provided.

@shfshanyue shfshanyue added the css label Jun 10, 2020
@shfshanyue
Copy link
Owner Author

shfshanyue commented Jul 19, 2020

  1. 伪类使用单冒号,而伪元素使用双冒号。如 :hover 是伪类,::before 是伪元素
  2. 伪元素会在文档流生成一个新的元素,并且可以使用 content 属性设置内容

参考 https://www.w3.org/TR/CSS2/selector.html#pseudo-elements

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