我的代码是:
p {
position: relative;
background-color: blue;
}
p:before {
content: '';
position: absolute;
left:100%;
width: 10px;
height: 100%;
background-color: red;
}
Run Code Online (Sandbox Code Playgroud)
请看这个小提琴:http://jsfiddle.net/ZWw3Z/5/
我想仅在伪元素(红色位)上触发click事件.也就是说,我不希望在蓝色位上触发click事件.
我想知道以下是否可行.我知道它不起作用,但也许我不是用正确的语法编写它.
li.first div.se_bizImg:before{
content: "<h1>6 Businesses Found <span class="headingDetail">(view all)</span></h1>";
}
Run Code Online (Sandbox Code Playgroud)
无论如何这样做?