为了账号安全,请及时绑定邮箱和手机立即绑定

用css怎么做一个条纹效果?? 虚心请教

/ 猿问

用css怎么做一个条纹效果?? 虚心请教

so_bad 2020-03-29 16:00:38

http://img2.sycdn.imooc.com/5e8055460001555502020206.jpg

就左上角的那块红色区域需要怎么做啊,无头绪 想请大家帮帮忙

查看完整描述

2 回答

已采纳
?
第二钢协
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title></title>
        <style>
            .box{width: 200px;height: 200px;position: relative;overflow: hidden; /* 超出的部分隐藏 */}
            .box img{width: 100%;height: auto;display: block;}
            .box .badge{position: absolute;top: 20px;left: -30px;background: red;color: #fff;width: 120px;text-align: center;transform: rotate(-45deg);}
        </style>
    </head>
    <body>
        <div class="box">
            <div class="badge">ON SALE</div>
            <img src="https://cdn.img.wenhairu.com/images/2020/03/30/FPODI.jpg" alt="">
        </div>
    </body>
</html>


查看完整回答
反对 回复 2020-03-30
  • 第二钢协
    第二钢协
    把这段代码,拷贝到一个html文件里,然后在浏览器运行即可看到效果
  • so_bad
    so_bad
    嗷嗷原来是这样 谢谢你!
  • 第二钢协
    第二钢协
    核心难点是 css3 transform,你可以去查查这块儿的资料
?
慕数据6348972

导航模块链接:

http://zhaopin.waihuo.com/baoyang8/img8590.shtml

http://zhaopin.waihuo.com/baoyang8/img8591.shtml

http://zhaopin.waihuo.com/baoyang8/img8592.shtml

http://zhaopin.waihuo.com/baoyang8/img8593.shtml

http://zhaopin.waihuo.com/baoyang8/img8594.shtml

http://zhaopin.waihuo.com/baoyang8/img8595.shtml

http://zhaopin.waihuo.com/baoyang8/img8596.shtml

http://zhaopin.waihuo.com/baoyang8/img8597.shtml

http://zhaopin.waihuo.com/baoyang8/img8598.shtml

http://zhaopin.waihuo.com/baoyang8/img8599.shtml

http://zhaopin.waihuo.com/baoyang8/img8600.shtml

http://zhaopin.waihuo.com/baoyang8/img8601.shtml

http://zhaopin.waihuo.com/baoyang8/img8602.shtml

http://zhaopin.waihuo.com/baoyang8/img8603.shtml

http://zhaopin.waihuo.com/baoyang8/img8604.shtml

http://zhaopin.waihuo.com/baoyang8/img8605.shtml

http://zhaopin.waihuo.com/baoyang8/img8606.shtml

http://zhaopin.waihuo.com/baoyang8/img8607.shtml

http://zhaopin.waihuo.com/baoyang8/img8608.shtml

http://zhaopin.waihuo.com/baoyang8/img8609.shtml

http://zhaopin.waihuo.com/baoyang8/img8610.shtml

http://zhaopin.waihuo.com/baoyang8/img8611.shtml

http://zhaopin.waihuo.com/baoyang8/img8612.shtml

http://zhaopin.waihuo.com/baoyang8/img8613.shtml

http://zhaopin.waihuo.com/baoyang8/img8614.shtml

http://zhaopin.waihuo.com/baoyang8/img8615.shtml

http://zhaopin.waihuo.com/baoyang8/img8616.shtml

http://zhaopin.waihuo.com/baoyang8/img8617.shtml

导航模块链接:

http://zhaopin.waihuo.com/baoyang8/

http://zhaopin.waihuo.com/baoyang8/about/

http://zhaopin.waihuo.com/baoyang8/notice/

http://zhaopin.waihuo.com/baoyang8/zhaopian/

http://zhaopin.waihuo.com/baoyang8/zhaopin/

http://zhaopin.waihuo.com/baoyang8/news/

http://zhaopin.waihuo.com/baoyang8/jianzhi/

http://zhaopin.waihuo.com/baoyang8/rongyu/

http://zhaopin.waihuo.com/baoyang8/guest/

http://zhaopin.waihuo.com/baoyang8/contact/

图片链接:

http://zhaopin.waihuo.com/baoyang8/img8334.shtml

http://zhaopin.waihuo.com/baoyang8/img8335.shtml

http://zhaopin.waihuo.com/baoyang8/img8336.shtml

http://zhaopin.waihuo.com/baoyang8/img8337.shtml

http://zhaopin.waihuo.com/baoyang8/img8338.shtml

http://zhaopin.waihuo.com/baoyang8/img8339.shtml

http://zhaopin.waihuo.com/baoyang8/img8340.shtml

http://zhaopin.waihuo.com/baoyang8/img8341.shtml

http://zhaopin.waihuo.com/baoyang8/img8342.shtml

http://zhaopin.waihuo.com/baoyang8/img8343.shtml

http://zhaopin.waihuo.com/baoyang8/img8344.shtml

http://zhaopin.waihuo.com/baoyang8/img8345.shtml

http://zhaopin.waihuo.com/baoyang8/img8346.shtml

http://zhaopin.waihuo.com/baoyang8/img8347.shtml

http://zhaopin.waihuo.com/baoyang8/img8348.shtml

http://zhaopin.waihuo.com/baoyang8/img8349.shtml

http://zhaopin.waihuo.com/baoyang8/img8350.shtml

http://zhaopin.waihuo.com/baoyang8/img8351.shtml

http://zhaopin.waihuo.com/baoyang8/img8352.shtml

http://zhaopin.waihuo.com/baoyang8/img8353.shtml

http://zhaopin.waihuo.com/baoyang8/img8354.shtml

http://zhaopin.waihuo.com/baoyang8/img8355.shtml

http://zhaopin.waihuo.com/baoyang8/img8356.shtml

http://zhaopin.waihuo.com/baoyang8/img8357.shtml

http://zhaopin.waihuo.com/baoyang8/img8358.shtml

http://zhaopin.waihuo.com/baoyang8/img8545.shtml

http://zhaopin.waihuo.com/baoyang8/img8546.shtml

http://zhaopin.waihuo.com/baoyang8/img8547.shtml

http://zhaopin.waihuo.com/baoyang8/img8548.shtml

http://zhaopin.waihuo.com/baoyang8/img8549.shtml

http://zhaopin.waihuo.com/baoyang8/img8550.shtml

http://zhaopin.waihuo.com/baoyang8/img8551.shtml

http://zhaopin.waihuo.com/baoyang8/img8552.shtml

http://zhaopin.waihuo.com/baoyang8/img8553.shtml

http://zhaopin.waihuo.com/baoyang8/img8554.shtml

http://zhaopin.waihuo.com/baoyang8/img8555.shtml

http://zhaopin.waihuo.com/baoyang8/img8556.shtml

http://zhaopin.waihuo.com/baoyang8/img8557.shtml

http://zhaopin.waihuo.com/baoyang8/img8558.shtml

http://zhaopin.waihuo.com/baoyang8/img8559.shtml

http://zhaopin.waihuo.com/baoyang8/img8560.shtml

http://zhaopin.waihuo.com/baoyang8/img8561.shtml

http://zhaopin.waihuo.com/baoyang8/img8562.shtml


查看完整回答
反对 回复 2020-09-30

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信