问:
现在有一个html代码文件, 引入了一个css样式文件, 这个文件我们无法修改, 现在有一个::after属性, 我希望删除这个::after属性, 新写一个::before属性, 怎么写?
回答:
首先我们写一个::before属性,
.AI_service_wrapper .AI_question .details .right .content li::before{
display: inline; /* 之前是display:block;现在改为inline */
float: right;
border: 2px solid #191F39;
border-top: 0;
border-left: 0;
width: 6px;
height: 6px;
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
margin-top: .1333333333rem;
content: '';
position: absolute;
right: 0;
}
然后我们重置之前已经有的::after属性:
.AI_service_wrapper .AI_question .details .right .content li::after{
content: none;
}
使用content: none;将之前的::after属性重置清空了.