-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] 第19天 css的属性content有什么作用呢?有哪些场景可以用到? #63
Comments
|
针对这道题写了篇blog,原文链接:https://xiangshuo.blog.csdn.net/article/details/89843456 认识
|
Demo codepen 地址:https://codepen.io/xiangshuo1992/pen/zQGyBW |
content属性一般是给::before, ::after这两个伪类提供内容。 |
可以给伪元素设置内容,一般用于字体图标,防止图标文字和内容文字冲突,又可以将文字都写在css中方便管理 |
CSS 的
|
作用:给元素加内容 应用场景:
|
|
与伪元素结合使用,在元素前面或者后面插入相关内容 |
清除父子元素margin-top叠加时可以用到 |
定义CSS的 使用content 属性插入的内容都是匿名的可替换元素 作用
|
content属性与::before及::after伪元素配合使用,在元素头或者尾部来插入生成内容 |
CSS 的
以下是一些使用场景:
需要注意的是, |
|
第19天 css的属性content有什么作用呢?有哪些场景可以用到?
The text was updated successfully, but these errors were encountered: