首页 > 其他 > 详细

background-attachment与background-position 的问题

时间:2018-09-06 20:53:22      阅读:210      评论:0      收藏:0      [点我收藏+]

background-attachment:fixed | scroll

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习 1</title>
    <style>
        body{
            margin: 0;
        }
        .backgroundCss{
            width: 400px;
            height: 600px;
            border: 1px solid indianred;
            background-color: blanchedalmond;
            background-image: url(‘img/background.png‘);
            background-repeat: no-repeat;
            background-position: right 100px;
            background-attachment: fixed;
        }
    </style>
</head>
<body>
    <div class="backgroundCss"></div>
</body>

效果:

技术分享图片

理想效果为:

技术分享图片

更改background-attachment:scroll即可解决。

background-attachment与background-position 的问题

原文:https://www.cnblogs.com/amy2017/p/9600846.html

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