css的一些基本属性

2017-08-21  本文已影响7人  动感超人丶

注意:行内标签宽高默认是以内容决定的,无法更改。但是标签添加浮动以后,可以更改宽高

        *{
            margin: 0;
            padding: 0;
        }

        /*背景图平铺、位置*/
        .back{
            width: 1000px;
            height: 500px;
            background-color: red;
            background-image: url("ti.jpg");
            background-repeat: no-repeat;
            background-position: center top;
            background-position: 10px 10px;
        }
        /*body添加背景图*/
        body{
            background-image: url("ti.jpg");
            background-attachment: fixed;
            background-repeat: no-repeat;
        }
        /*列表前面标*/
        ul{
            list-style-type: none;
            list-style-image: url("ti.jpg");
        }
        /*表格合并线*/
        table{
            border: 1px solid blue;
            border-collapse: collapse;
        }

        td{
            border: 1px solid orange;
        }

        .news{

            width: 300px;
            height: auto;
            border: 1px solid red;
            margin: auto;
        }

        .news h1{

            height: 48px;
            background-color: #e6e6e6;
            font-size: 16px;
            color: #0066ff;
            line-height: 48px;
        }
        .news ul{
            list-style-type: none;
        }

        .news li{
            padding-left: 10px;
            line-height: 40px;
            border-bottom: 1px dashed darkgrey;
        }
上一篇 下一篇

猜你喜欢

热点阅读