常用命名
標題: title
摘要: summary
箭頭: arrow
商標: label
網(wǎng)站標志: logo
轉(zhuǎn)角/圓角: corner
橫幅廣告: banner
子菜單: subMenu
搜索: search
搜索框: searchBox
登錄: login
登錄條:loginbar
工具條: toolbar
下拉: drop
標簽頁: tab
當(dāng)前的: current
列表: list
滾動: scroll
服務(wù): service
提示信息: msg
熱點:hot
新聞: news
小技巧: tips
下載: download
欄目標題: title
熱點: hot
加入: joinus
注冊: regsiter
指南: guide
友情鏈接: friendlink
狀態(tài): status
版權(quán): copyright
按鈕: btn
合作伙伴: partner
投票: vote
左/右/中:left/right/center
簡介:profiles
評論:comment
ID命名
(1)頁面結(jié)構(gòu)
容器: container
頁頭:header
內(nèi)容:content/container
頁面主體:main
頁尾:footer
導(dǎo)航:nav
側(cè)欄:sidebar
欄目:column
頁面外圍控制整體布局寬度:wrapper
左右中:left right center
(2)導(dǎo)航
導(dǎo)航:nav
主導(dǎo)航:mainbav
子導(dǎo)航:subnav
頂導(dǎo)航:topnav
邊導(dǎo)航:sidebar
左導(dǎo)航:leftsidebar
右導(dǎo)航:rightsidebar
菜單:menu
子菜單:submenu
標題: title
摘要: summary
(3)功能
標志:logo
廣告:banner
登陸:login
登錄條:loginbar
注冊:regsiter
搜索:search
功能區(qū):shop
標題:title
加入:joinus
狀態(tài):status
按鈕:btn
滾動:scroll
標簽頁:tab
文章列表:list
提示信息:msg
當(dāng)前的: current
小技巧:tips
圖標: icon
注釋:note
指南:guild
服務(wù):service
熱點:hot
新聞:news
下載:download
投票:vote
合作伙伴:partner
友情鏈接:link
版權(quán):copyright
class命名
(1)顏色:使用顏色的名稱或者16進制代碼,如:
.red { color: red; }
.f60 { color: #f60; }
.ff8600 { color: #ff8600; }
(2)字體大小,直接使用"font+字體大小"作為名稱,如:
.font12px { font-size: 12px; }
.font9pt {font-size: 9pt; }
(3)對齊樣式,使用對齊目標的英文名稱,如:
.left { float:left; }
.bottom { float:bottom; }
(4)標題欄樣式,使用"類別+功能"的方式命名,如:
.barnews { }
.barproduct { }
推薦的CSS書寫順序
相關(guān)的屬性聲明應(yīng)當(dāng)歸為一組,并按照下面的順序排列:
Positioning
Box model
Typographic
Visual
由于定位(positioning)可以從正常的文檔流中移除元素赎线,并且還能覆蓋盒模型(box model)相關(guān)的樣式蛉加,因此排在首位。盒模型排在第二位皆刺,因為它決定了組件的尺寸和位置。
.xxx {
/* Positioning */
position: absolute;
top:0;
right:0;
bottom:0;
left:0;
z-index:100;
/* Box-model */
display: block;
float: right;
width: 100px;
height: 100px;
/* Typography */
font: normal 13px "Helvetica Neue", sans-serif;
line-height:1.5;
color:#333;
text-align: center;
/* Visual */
background-color:#f5f5f5;
border: 1px solid #e5e5e5;
border-radius: 3px;
/* Misc */
opacity:1;
}
如果你想學(xué)習(xí)交流html5css3等web前端技術(shù)凌摄,想多了解一些前端方面的內(nèi)容羡蛾,可以加入我們的QQ學(xué)習(xí)群:27062964,一起學(xué)習(xí)交流锨亏,提升自己痴怨,有學(xué)習(xí)資料和源碼分享∑饔瑁或者點擊鏈接直接加入QQ群:https://jq.qq.com/?_wv=1027&k=48DmPsZ