我有一个div并应用:before和:after图像作为内容.这非常有效.现在我需要应用背景图像,因此它会像div调整大小一样重复,但它似乎不起作用.是背景图像:before并且:after应该工作?
目前的代码:
HTML:
<div id="videos-part">test</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#videos-part{
background-color: #fff;
height: 127px;
width: 764px;
margin: -6px 0 -1px 18px;
position: relative;
}
#videos-part:before{
width: 16px;
content: " ";
background-image: url(/img/border-left3.png);
position: absolute;
left: -16px;
top: -6px;
}
Run Code Online (Sandbox Code Playgroud)