首页 > 其他 > 详细

background-attachment: fixed

时间:2020-12-13 10:02:56      阅读:33      评论:0      收藏:0      [点我收藏+]
技术分享图片 技术分享图片 技术分享图片
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .img11 {
            background-image: url(test.png);
            /* 定电脑 */
            background-attachment: fixed;
            background-repeat: no-repeat;
            width: 300px;
            height: 200px;
        }
        /* ”正常盒子“随滚轮移动的时候,会覆盖掉“背景图固定的盒子”  */
        
        .box {
            width: 100px;
            height: 10000px;
            background-color: rgba(120, 120, 120, 30);
        }
    </style>
</head>

<body>
    <div class="img11">背景图固定的盒子</div>
    <div class="box">正常盒子</div>
</body>

</html>

background-attachment: fixed

原文:https://www.cnblogs.com/icemiaomiao3/p/14127870.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!