怎样写出简洁的css代码??★★★★
生活随笔
收集整理的這篇文章主要介紹了
怎样写出简洁的css代码??★★★★
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
base.css 設置各種默認值:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; list-style:none; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } :focus { outline: 0; } ins { text-decoration: none; } del { text-decoration: line-through; } table { border-collapse: collapse; border-spacing: 0; }
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clear {clear: both;}
*{ margin: 0; padding:0;}
img{ width: 100%; display: block;}
a {text-decoration: none; color: #000; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);-webkit-tap-highlight-color: transparent;}
section {width: 100%;height: auto;min-height: 100%;max-width: 640px; min-width:320px;margin:0 auto;padding: 0;position: relative;background: #f8f1e9;}
body{color:#000;background-color: #FFF;padding:0px; margin:0px auto;overflow:scroll;overflow-x:hidden;overflow-y:auto; font-family: Microsoft YaHei,Helvitica,Verdana,Tohoma,Arial,san-serif; font-size: 14px;font-size: 1em; font-size: 87.5%; max-width:640px;}
/*頭部*/ .header {} .header .h_top{} /*尾部*/ .footer{} .footer p{} .footer p span{}
/***************************/ .row-1{} .row-1 .r1_top{} .row-1 .r1_left{} /***************************/ .row-2{} .row-2 .r2_left{} .row-2 .box{} .row-2 .login{} /***************************/ .login{} .login .l_left{} .login .l_right{} /***************************/ <link rel="stylesheet" type="text/css" href="css/base.css"/> <!-- 公共樣式 --> <link rel="stylesheet" type="text/css" href="css/index.css"/> <!-- 功能模塊樣式-->
.clear {clear: both;}
*{ margin: 0; padding:0;}
img{ width: 100%; display: block;}
a {text-decoration: none; color: #000; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);-webkit-tap-highlight-color: transparent;}
section {width: 100%;height: auto;min-height: 100%;max-width: 640px; min-width:320px;margin:0 auto;padding: 0;position: relative;background: #f8f1e9;}
body{color:#000;background-color: #FFF;padding:0px; margin:0px auto;overflow:scroll;overflow-x:hidden;overflow-y:auto; font-family: Microsoft YaHei,Helvitica,Verdana,Tohoma,Arial,san-serif; font-size: 14px;font-size: 1em; font-size: 87.5%; max-width:640px;}
/*頭部*/ .header {} .header .h_top{} /*尾部*/ .footer{} .footer p{} .footer p span{}
?
index.css:功能模塊/***************************/ .row-1{} .row-1 .r1_top{} .row-1 .r1_left{} /***************************/ .row-2{} .row-2 .r2_left{} .row-2 .box{} .row-2 .login{} /***************************/ .login{} .login .l_left{} .login .l_right{} /***************************/ <link rel="stylesheet" type="text/css" href="css/base.css"/> <!-- 公共樣式 --> <link rel="stylesheet" type="text/css" href="css/index.css"/> <!-- 功能模塊樣式-->
?
<link rel="stylesheet" type="text/css" href="css/base.css"/> <!-- 公共樣式 --> <link rel="stylesheet" type="text/css" href="css/login.css"/> <!-- 功能模塊樣式--> <link rel="stylesheet" type="text/css" href="css/base.css"/> <!-- 公共樣式 --> <link rel="stylesheet" type="text/css" href="css/selector.css"/> <!-- 功能模塊樣式-->?
按照功能模塊把css? js區分開。
?
轉載于:https://www.cnblogs.com/shimily/articles/4402111.html
總結
以上是生活随笔為你收集整理的怎样写出简洁的css代码??★★★★的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初探数位DP-hdu2089
- 下一篇: hdu 1165 坑爹找规律题