其他分享
首页 > 其他分享> > 91-100 CSS 设置一个图片(img)作为页面的背景

91-100 CSS 设置一个图片(img)作为页面的背景

作者:互联网

 

   

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-image: url('../jQueryLibrary/img/11.jpg');
            /* 背景图 写在下面的把上面的覆盖掉了 */
            background-image: url('../jQueryLibrary/img/3.jpg');
            /* 需要调整图片的大小,到合适尺寸就可以了  */
            background-image: url('../jQueryLibrary/img/sky.jpg');
            /* 城市背景 */
            /* background-image: url('../jQueryLibrary/img/city.jpg'); */
            /* 居中对齐
            text-align: center; */
            background-color: #cccccc;
        }
    </style>
</head>

<body>
    <h1>hello world</h1>
    <h1>你好 上海</h1>
    <h2>你好 济南</h2>
</body>

效果

   

 

标签:..,img,image,jpg,background,91,100,jQueryLibrary
来源: https://www.cnblogs.com/zhuiqiuzhuoyueyouminxing/p/15845905.html