zoukankan      html  css  js  c++  java
  • 02-CSS基础与进阶-day3_2018-08-29-20-39-58

    03背景.html

    <!DOCTYPE html>
    <html lang="en">
    <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>Document</title>
        <style>
            body {
                background-color: #ccc;
            }
            div {
                width: 400px;
                height: 500px;
                background-color: pink;
                background-image: url(img/l.jpg);
                background-repeat: no-repeat;
                /*利用方位名词来改变背景图片的位置*/
                background-position: left top;/* 默认左上角*/ 
                background-position: bottom right; /*右下角 方位名词不分顺序*/
                background-position: center center;
                background-position: left; /*方位名词只写一个 另一个默认为center*/
                background-position: 10px 30px; /*第一个为x坐标  第二个为y坐标*/
                background-position:  10px center;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
    </html>

     04背景案例.html

    <!DOCTYPE html>
    <html lang="en">
    <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>Document</title>
        <style>
            body {
                /*
                background-image: url(img/ms.jpg);
                background-position: center -30px;
                background-repeat: no-repeat;
                background-color: #000;
                 设置背景图像是否随内容滚动
                background-attachment: fixed; 
                 background-attachment: scroll; 默认是滚动的*/
                 background: #000 url(img/ms.jpg) no-repeat fixed center -30px;
            }
    
            p {
                font-size: 22px;
                color: #fff;
            }
        </style>
    </head>
    <body>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
        <p>内容部分</p>
    </body>
    </html>
  • 相关阅读:
    Go语言十六进制转十进制
    Go语言中底层数组和切片的关系以及数组扩容规则
    Golang超时机制--2秒内某个函数没被调用就认为超时
    约瑟夫环问题(猴子选大王)
    冒泡排序优化
    斐波那契数列
    Linux下使用acme.sh (Let's Encrypt) 配置https 免费证书
    git 本地分支指定对应的远程分支
    Git分支开发 -- 利用git pull命令将远程指定仓库的分支拉取到本地
    phpStorm 之 本地开发,Linux上跑项目(连接远端服务器开发)
  • 原文地址:https://www.cnblogs.com/HiJackykun/p/11042483.html
Copyright © 2011-2022 走看看