在每個元素的內容之前插入新內容:
<p>小哪吒</p>
p:before{
content: '我們的朋友:';
}
:before選擇器和:after選擇器一樣,不過是一個在元素前插入新內容,一個在元素后插入新內容
h3::before {
content: "";
position: absolute;
left: 0;
top: 50%;
margin-top: -11px;
height: 24px;
width: 4px;
background: #0984e3;
}
圖中的藍色線就是用:before選擇器寫出來的