document.write("");

html ::before css

给指定Id为video添加对应::before的css

     var style1 = document.createElement('style');
     style1.innerHTML = `#video::before { content: ""; display: inline-block; background-image:url(${img}); background-size: cover;}`;
     document.head.appendChild(style1);

  

posted @ 2023-07-13 09:26  人间春风意  阅读(18)  评论(0)    收藏  举报