总结css样式

 <style>
         /* 公共样式 */
         *{
            margin:0;/*外边距:0*/
            padding:0;/*内边距:0*/
         }
         li{
            list-style:none;/*设置列表属性:无*//*去掉ul里默认的点*/
         }
         a{
            text-decoration:none;/*文本装饰效果:无*//*去掉a标签下划线*/
         }
         .nav{
            width:1200px;/*宽:1200像素*/
            /* border:1px solid #000; */
            margin:20px auto;/*元素水平居中*/
         }
         /* 。nav清楚浮动 */
         .nav:after{/*伪元素*/
            content:"";/*内容:空*/
            display:block;/*元素方式:块元素*/
            clear:both;/*清楚浮动:两端*/
         }
         .nav_logo,.nav_list{
            float:left;/*浮动:左*/
         }
         .nav_list{
            overflow:hidden;/*清除浮动*//*溢出:隐藏*/
            margin-left:88px;/*外边距:左*/
            background:red;/*背景颜色:红*/
            height:38px;/*高:38像素*/
            line-height:38px;/*设置行高*/

         }
         .nav_list>li{
            float:left;/*浮动:左*/
            width:165px;/*宽:165像素*/
            /* border:1px solid #000; */
            text-align:center;/*水平对齐方式:居中*/
         }
         .nav_list>li>a{
            color:#fff;/*颜色:#fff*/
         }
         /* 汽车列表 */
        .car{
            width:1200px;/*宽:1200像素*/
            margin:0 auto;/*外边距:上下0 左右自动 *//*元素水平居中*/
            /* border:1px solid #000; */
            margin-top:50px;/*外边距-上:50像素*/
        }
        /* 汽车标题 */
        .car_title{
            text-align:center;/*文本-对齐:居中*/
        }
        .car_title>p{
            border:1px solid #000;/*边框:1像素 实线 黑色*/
            width:50px;/*宽:50像素*/
            display:inline-block;/*控制一个元素的状态:行内-块元素*/
            margin-bottom:5px;/*外边距-下:5像素*/
        }
        .car_title>i{
            font-weight:bold;/*字体属性-字体粗细:粗*/
            font-size:18px;/*字体属性-字体大小:18像素*/
        }
        /* 汽车列表 */
        .car_show>p,.car_show>ul{
            float:left;/*浮动:左*/
        }
        .car_show{
            margin-top:20px;/*外边距-上:20像素*/
        }
        .car_show:after{/*伪元素*/
            content:"";/*内容:空*/
            display:block;/*控制一个元素的状态:块元素*/
            clear:both;/*清除浮动:两端*/
        }
        .car_show>ul{
            overflow:hidden;/*溢出:隐藏*/
            border-top:1px solid #000;/*边框-上:1像素 实线 黑色*/
            border-bottom:1px solid #000;/*边框-下:1像素 实线 黑色*/
            width:900px;/*宽:900像素*/
        }
        .car_show>ul>li{
            float:left;/*浮动:左*/
            width:224px;/*宽:224像素*/
            text-align:center;/*文本-对齐:居中*/
            border-right:1px solid #000;/*边框-右:1像素 实线 黑色*/
        }
        .car_show>ul>li>p{
            text-align:left;/*文本-对齐:左对齐*/
            padding-left:5px;/*内边距-左:5像素*/
            line-height:35px;/*设置行高:35像素*/
        }
        .car_show>ul>li>span{
            text-align:left;/*文本-对齐:左对齐*/
            padding-left:5px;/*内边距-左:5像素*/
            display:inline-block;/*控制一个元素的状态:行内-块元素*/
            width:100%;/*宽:百分之百*/
            color:red;/*颜色:红*/
        }
        .car_show>ul>li:nth-child(5),
        .car_show>ul>li:nth-child(6),
        .car_show>ul>li:nth-child(7),
        .car_show>ul>li:last-child{ 
            padding-top:18px;/*内边距-上:18像素*/
        }
    </style>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容