Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是 HTML
<p>x1</p> <p>x2</p>
我希望 css 先选择 < p> 然后使用“:after”选择器:
p:nth-child(1):after{ content:"- X1 !"; }
这基本上应该做的是在第一个<p>之后添加“-X1!” 但是它不起作用,怎么做?
它确实有效,请参见此处:http: //jsbin.com/ujolek/2/edit
你也可以这样做:
p:first-child:after{ content:"- X1 !" }