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
答案:
1、伪元素使用 2 个冒号,常见的有:::before,::after,::first-line,::first-letter,::selection、::placeholder 等;
伪类使用1个冒号,常见的有::hover,:link,:active,:target,:not(),:focus等。
2、伪元素添加了一个页面中没有的元素(只是从视觉效果上添加了,不是在文档树中添加);
伪类是给页面中已经存在的元素添加一个类。
解析:
CSS 伪元素是添加到选择器的关键字,去选择元素的特定部分。它们可以用于装饰(:first-line,:first-letter)或将元素添加到标记中(与 content:...组合),而不必修改标记(:before,:after)。
:first-line
:first-letter
:before
:after
.clearfix
clear: both
after
参考
The text was updated successfully, but these errors were encountered:
E:first-letter/E::first-letter E:first-line/E::first-line E:before/E::before E:after/E::after E::placeholder E::selection
伪元素中,有几个使用单冒号也是可以的,不过建议双冒号
建议在面试题那,把没答案的在标题里注释出来
Sorry, something went wrong.
我想着尽快把项目汇总的面试题,同步到issues,再下一步就是把没答案的在目录说明,这样大家就可以在对应issues写出自己的答案了。
No branches or pull requests
答案:
1、伪元素使用 2 个冒号,常见的有:::before,::after,::first-line,::first-letter,::selection、::placeholder 等;
2、伪元素添加了一个页面中没有的元素(只是从视觉效果上添加了,不是在文档树中添加);
解析:
CSS 伪元素是添加到选择器的关键字,去选择元素的特定部分。它们可以用于装饰(
:first-line
,:first-letter
)或将元素添加到标记中(与 content:...组合),而不必修改标记(:before
,:after
)。:first-line
和:first-letter
可以用来修饰文字。.clearfix
方法中,使用clear: both
来添加不占空间的元素。:before
和after
展示提示中的三角箭头。鼓励关注点分离,因为三角被视为样式的一部分,而不是真正的 DOM。如果不使用额外的 HTML 元素,只用 CSS 样式绘制三角形是不太可能的。参考
The text was updated successfully, but these errors were encountered: