issues
search
chenliqio
/
fe-interview
前端面试题型汇总
0
stars
0
forks
source link
【CSS】Day9--::before和:after中单冒号和双冒号的区别是什么?这两个有什么作用?⭐️⭐️⭐️
#27
Open
chenliqio
opened
2 years ago
chenliqio
commented
2 years ago
一、伪类
伪类,表示不存在的类,特殊的类
伪类用来描述第一个元素的特殊状态(第一个子元素、被点击的元素。。。。)
一般情况下伪类是由一个:开头。
二、伪元素
表示页面中一些特殊的并不真实存在的元素。
伪元素一般是:: 开头
:: first-letter 第一个字母 :: first-line 第一行 :: before 元素的第一个位置 :: after 元素的最后一个位置 ps:before和after 需要和content属性连用,content里面的内容是要添加在元素前或者元素后的内容。
一、伪类
伪类,表示不存在的类,特殊的类
二、伪元素
表示页面中一些特殊的并不真实存在的元素。