zoukankan      html  css  js  c++  java
  • 文本,背景,边距属性

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>CSS属性1</title>
        <style>
            #div1{
                background: yellow;
                text-align: center; /*居中属性align*/
                line-height: 100px; /*背景高度*/
                color: red;
                font-size: 28px;
                font-style: italic;
            }
    
            #di2{
                height: 100px;/*画面高*/
                /*background: url("520.jpg" );
                background-repeat: no-repeat;
                background-size: auto;
                background-position: center;*/
    
                /*可以简写成下面的格式,图片,不重复显示图片,间隔,颜色*/
                /*background: url("520.jpg") no-repeat red;*/
            }
    
            .div3{
                border:dashed 5px ;
                height: 200px;
                width: 30%;
                background-color: chartreuse;
            }
    
            .div4{
                margin-top: 20px;
                margin-bottom: 20px;
                border:dashed 5px ;
                height: 200px;
                width: 30%;
                background-color: chartreuse;
            }
            .div5{
                border:dashed 5px ;
                line-height: 200px;
                width: 30%;
                background-color: chartreuse;
                text-align: center;
    
            }
        </style>
    </head>
    <body>
        <div id="div1">这个是文本</div> <!--文本属性-->
    
        <div id="di2"></div> <!--背景属性-->
    
        <div class="div3">这个是div3</div>  <!--边距属性-->
        <div class="div4">这个是div4</div>
        <div class="div5">这个是div5</div>
    
    </body>
    </html>
  • 相关阅读:
    Java Web-session介绍
    Java异常-一般异常和运行时异常的区别
    Spring控制Hibernate的缓存机制ehcache
    Hibernate-缓存
    Hibernate-入门教程
    Java算法-hash算法
    Java算法-各种题目总结
    Java算法-堆排序
    Java算法-快速排序
    Java算法-归并排序
  • 原文地址:https://www.cnblogs.com/TKOPython/p/12685997.html
Copyright © 2011-2022 走看看