在伪元素选择器后面添加图片后,如何设置图片的大小呢?

图片说明

    content: '';
    background: url(1.png) no-repeat;
    background-size: 100%;
    display: block;
    width: 50px;
    height: 50px;

content设为空,用background设置图片,background-size控制图片大小。

.box .selected:after{
    content:'';
    width: 100vw;
    height:100vh;
    position:fixed;
    top:35vmin;
    background: url(../images/bg1.jpg)no-repeat center;
    background-size:cover;
    opacity: 0.2;
}