css命令規範

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   ar   color   使用   sp   

一、命名規則說明

1)、所有的命名最好都小寫
2)、屬性的值一定要用雙引號("")括起來,且一定要有值如class="divcss5",id="divcss5"
3)、每個標籤都要有開始和結束,且要有正確的層次,排版有規律工整
4)、空元素要有結束的tag或於開始的tag後加上"/"
5)、表現與結構完全分離,代碼中不涉及任何的表現元素,如style、font、bgColor、border等
6)、<h1>到<h5>的定義,應遵循從大到小的原則,體現文檔的結構,並有利於搜尋引擎的查詢。
7)、給每一個表格和表單加上一個唯一的、結構標記id
8)、給圖片加上alt標籤
9)、盡量使用英文命名原則
10)、盡量不縮寫,除非一看就明白的單詞

二、CSS樣式命名規則:
CSS樣式命名 說明
網頁公用命名
#wrapper 頁面外圍控制整體布局寬度
#container或#content 容器,用於最外層
#layout 布局
#head, #header 頁頭部分
#foot, #footer 頁尾部分
#nav 主導航
#subnav 二級導航
#menu 菜單
#submenu 子功能表
#sideBar 側欄
#sidebar_a, #sidebar_b 左側邊欄或右側邊欄
#main 頁面主體
#tag 標籤
#msg #message 提示資訊
#tips 小技巧
#vote 投票
#friendlink 友情串連
#title 標題
#summary 摘要
#loginbar 登入條
#searchInput 搜尋輸入框
#hot 熱門熱點
#search 搜尋
#search_output 搜尋輸出和搜尋結果相似
#searchBar 搜尋條
#search_results 搜尋結果
#copyright 著作權資訊
#branding 商標
#logo 網站LOGO標誌
#siteinfo 網站資訊
#siteinfoLegal 法律聲明
#siteinfoCredits 信譽
#joinus 加入我們
#partner 夥伴
#service 服務
#regsiter 註冊
arr/arrow 箭頭
#guild 指南
#sitemap 網站地圖
#list 列表
#homepage 首頁
#subpage 二級頁面子頁面
#tool, #toolbar 工具條
#drop 下拉
#dorpmenu 下拉式功能表
#status 狀態
#scroll 滾動
.tab 標籤頁
.left .right .center 居左、中、右
.news 新聞
.download 下載
.banner 廣告條(頂部廣告條)
電子貿易相關
.products 產品
.products_prices 產品價格
.products_description 產品描述
.products_review 產品評論
.editor_review 編輯評論
.news_release 最新產品
.publisher 生產商
.screenshot 縮圖
.faqs 常見問題
.keyword 關鍵詞
.blog 部落格
.forum 論壇

 

 

CSS檔案命名 說明
master.css,style.css 主要的
module.css 模組
base.css 基本共用
layout.css 布局,版面
themes.css 主題
columns.css 專欄
font.css 文字、字型
forms.css 表單
mend.css 補丁
print.css 列印

 

轉自:

http://www.divcss5.com/jiqiao/j4.shtml

css命令規範

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.