jquery 显示图片

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
<meta charset="utf-8" />
    <script src="jquery-3.3.1.js"></script>
    <style>
        div{
            background-image:url(1.jpg);
            width:800px;
            height:800px;
            border:1px solid red;
            /*此时显示的图片为平铺*/

            background-repeat:no-repeat;

            /*显示图片某部分*/
            background-position:-275px -30px;

            background-position:-275px -30px;
        }
    </style>
</head>
<body>
    <div>


    </div>
</body>
</html>
posted @ 2018-03-30 21:24  dxm809  阅读(288)  评论(0)    收藏  举报