厦门建设网站企业,杭州网站建设维护,电子游戏设计方案,seo外贸仿牌网站换域名a)重点#xff1a;E::before、E::after
i.是一个行内元素#xff0c;需要转换成块:display:block float:** position:
ii.必须添加content,哪怕不设置内容#xff0c;也需要content:””
iii.E:after、E:before 在旧版本里是伪类#xff0c;在新版本里是伪元素#xff…a)重点E::before、E::after
i.是一个行内元素需要转换成块:display:block float:** position:
ii.必须添加content,哪怕不设置内容也需要content:””
iii.E:after、E:before 在旧版本里是伪类在新版本里是伪元素新版本下E:after、E:before会被自动识别为E::after、E::before按伪元素来对待这样做的目的是用来做兼容处理
iv.E::before: 定义在一个元素的内容之前插入content属性定义的内容与样式
v.E::after: 定义在一个元素的内容之后插入content属性定义的内容与样式
vi.注意
1.IE6、IE7与IE8怪异模式Quirks mode不支持此伪元素
2.CSS2中 E:before或者E:after是属于伪类的并且没有伪元素的概念CSS3中 提出伪元素的概念 E::before和E::after并且归属到了伪元素当中伪类里就不再存在E:before或者 E:after伪类
b)E::first-letter文本的第一个字母或字(不是词组)
c)E::first-line 文本第一行
d)E::selection 可改变选中文本的样式 style*{padding: 0;margin: 0;}body{padding: 200px;}div{height: 200px;float: left;}div:nth-of-type(1){width: 300px;background-color: yellowgreen;}div:nth-of-type(2){width: 150px;background-color: skyblue;position: relative;}div:nth-of-type(2)::before,div:nth-of-type(2)::after{position: absolute;content: ;width: 40px;height: 40px;border-radius: 50%;background-color: #fff;}div:nth-of-type(2)::before{left: -20px;top:-20px;}div:nth-of-type(2)::after{left: -20px;bottom:-20px;}
/style
bodydiv/divdiv/div
/body浏览器渲染如下: 转载于:https://www.cnblogs.com/Tobenew/p/10524953.html