zoukankan      html  css  js  c++  java
  • CSS设置背景

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
    /*1.如何设置背景图片*/
    body{
    background-image: url(../images/background.png);
    background-repeat: repeat-y;
    background-position: center;
    }
    /*2.可以采用简化的方式一起设置背景色及背景图.语法如下
    background:背景色 背景图 平铺 位置
    以上四个可以酌情省略,但至少保留背景色或背景图中的一个*/
    .enemy{
    border: 1px solid red;
    50px;
    height: 50px;
    margin: 20px auto;
    background: url(../images/airplane.png) no-repeat center;


    }
    .hero{
    border: 1px solid red;
    125px;
    height: 125px;
    margin: 20px auto;
    background: url(../images/hero0.png) no-repeat center;
    }
    /*3.固定背景图*/
    body{
    background-attachment: fixed;
    }
    </style>
    </head>
    <body>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="enemy"></div>
    <div class="hero"></div>
    <div class="hero"></div>

    </body>
    </html>

  • 相关阅读:
    最短路径问题
    这是我的第一篇博客
    Time Series Anomaly Detection
    R-CNN, Fast R-CNN, Faster R-CNN, Mask R-CNN
    database 学习
    AWS Cloud Practioner 官方课程笔记
    Cassandra commands
    go 语言学习
    [Udemy] ES 7 and Elastic Stack
    第9章 内联函数
  • 原文地址:https://www.cnblogs.com/Bighua123/p/7588150.html
Copyright © 2011-2022 走看看