将伪元素嵌套在伪元素中

时间:2012-01-25 17:50:32

标签: css css3 pseudo-element

我有一个:开头'报价'之前和之后:收盘报价。

现在我想要的是:之后:在'引用'参考之后但是我无法让它工作。

有人知道这是否可行?

到目前为止我的代码: -

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;
    }

1 个答案:

答案 0 :(得分:46)

已经提出了嵌套::before::after伪元素的想法;请参阅Generated and Replaced Content模块的this section。但是,该模块已被放弃pending a complete rewrite,所以在重新发布之前,我不会屏住呼吸这个文件。即便如此,嵌套内容伪元素仍然是一件事仍然是未知的。