美文网首页
通过css切换img标签的src路径

通过css切换img标签的src路径

作者: _重案组之虎 | 来源:发表于2020-11-27 16:02 被阅读0次
    content属性
    .imgDom:hover {
        content: url('https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1060453240,1808119494&fm=26&gp=0.jpg');
    }
    
    <img class="imgDom" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2433440561,1509408021&fm=26&gp=0.jpg" alt="">
    

    如果不行可能是图片链接失效了,可以换一个试试

    相关文章

      网友评论

          本文标题:通过css切换img标签的src路径

          本文链接:https://www.haomeiwen.com/subject/upbxwktx.html