我的来源是xml(不是HTML),我无法对其进行修改。
如果CSS具有父选择器,这将很容易。
此XML
<p>Have you heard <quote>I never saw a purple cow</quote>? It is a silly poem.</p>
<p>
It goes like this. <quote><l>I never saw a purple cow.</l>
<l>I never hope to see one.</l>
<l>But I can tell you anyhow,</l>
<l>I’d rather see than be one.</l></quote> Isn’t that silly?
</p>
和此CSS
quote::before {content:"“"}
quote::after {content:"”"}
/* For lines inside quotes */
quote > l {display:block; margin-left:2em}
产生此输出
是否有一些欺骗手段可以产生相同的结果,但是我没有圈出两个引号?
(如果不删除引号而是将引号移到诗歌的第一行的开头,而将引号的结尾移到最后一行的末尾也可以。)