在伪元素中嵌套伪元素 [英] Nesting pseudo-elements inside pseudo-elements
问题描述
我有一个:之前的开头'报价'和一个:后的结束报价。
I have a :before for an opening 'quote' and an :after for a closing quote.
现在我想要的是:
有没有人知道这是否可能?
Does anyone know if this is possible?
我的代码到目前为止: -
My code so far:-
blockquote:before { content: '\201C'; }
blockquote:after { content: '\201D'; }
blockquote {
font-size: 22px;
line-height: 24px;
text-indent:60px;
}
blockquote:before {
font-size: 170px;
margin-left: -136px;
margin-top: 50px;
opacity: 0.2;
position: absolute;
overflow:visible;
float:left;
width:135px;
}
blockquote:after {
float: right;
font-size: 170px;
margin-right: 35px;
margin-top: 33px;
opacity: 0.2;
overflow:visible;
width:135px;
}
blockquote[cite]:after:after {
display: block;
text-align: right;
content: "\2014\ " attr(cite);
font-style: normal;
font-size: 0.8em;
}
推荐答案
嵌套的想法 :: before
和 :: after
伪元素;请参阅生成和替换内容模块的此部分。但是,该模块已被放弃等待完全重写,因此我无法保留我的呼吸在这份文件有接收实施,直到它被重新出版。即使这样,嵌套内容伪元素是否仍然是一个东西,仍然是未知的。
The idea of nesting ::before
and ::after
pseudo-elements has been proposed; see this section of the Generated and Replaced Content module. However, that module has been abandoned pending a complete rewrite, so I wouldn't hold my breath on this document ever receiving implementation until it's republished. And even then, whether nesting content pseudo-elements will still be a thing is as yet unknown.
这篇关于在伪元素中嵌套伪元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!