初始化CSS元素_Div+CSS教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
為什么要初始化CSS?在前面的文章中,我們講過CSS初始化是指重設(shè)瀏覽器的樣式。不同的瀏覽器默認(rèn)的樣式可能不近相同,所有開發(fā)時(shí)的第一件事可能就是如果把他們統(tǒng)一。
也許他們平時(shí)做頁(yè)面時(shí)根本就沒考慮過瀏覽器兼容的問題。其實(shí)不同瀏覽器對(duì)有些標(biāo)簽的默認(rèn)值是不同的,如果沒對(duì)CSS初始化往往會(huì)出現(xiàn)瀏覽器之間的頁(yè)面差異。
初始化CSS的一個(gè)小實(shí)例:
也許他們平時(shí)做頁(yè)面時(shí)根本就沒考慮過瀏覽器兼容的問題。其實(shí)不同瀏覽器對(duì)有些標(biāo)簽的默認(rèn)值是不同的,如果沒對(duì)CSS初始化往往會(huì)出現(xiàn)瀏覽器之間的頁(yè)面差異。
初始化CSS的一個(gè)小實(shí)例:
示例代碼 [m.dounai2.com]
html, body, div, span,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
img, ins, kbd, q, s, samp,
small, strike, strong,
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: baselinebaseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
img, ins, kbd, q, s, samp,
small, strike, strong,
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: baselinebaseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
相關(guān)Div+CSS教程:
- DIV+CSS設(shè)計(jì)的誤區(qū)
- CSS基礎(chǔ):常用CSS英文字體介紹
- IE6和IE7中border邊框斷線現(xiàn)象
- border:none;與border:0;的有什么不同?
- div+css下js對(duì)聯(lián)廣告不隨屏幕滾動(dòng)的解決方法
- HTML元素的ID和Name屬性的區(qū)別
- divcss教程:深入了解css的行高Line Height屬性
- CSS文檔流,塊級(jí)元素和內(nèi)聯(lián)元素
- 5個(gè)你該知道的CSS3新技術(shù)
- 用正則表達(dá)式替換a標(biāo)記href值
- 30個(gè)優(yōu)秀的CSS導(dǎo)航和按鈕設(shè)計(jì)教程
- css中px和em有什么區(qū)別
Div+CSS教程Rss訂閱Div+Css教程搜索
Div+CSS教程推薦
- CSS實(shí)戰(zhàn)經(jīng)驗(yàn):保持CSS文件整潔與樣式統(tǒng)一
- 有人說div CSS網(wǎng)頁(yè)布局比較愚蠢,我來說兩句!
- 頁(yè)面最小一屏,而頁(yè)腳保持在頁(yè)面底部的布局!
- 為什么要Web標(biāo)準(zhǔn)化,有何價(jià)值?
- Web Developer插件概要
- 30個(gè)優(yōu)秀的CSS導(dǎo)航和按鈕設(shè)計(jì)教程
- 應(yīng)用DIV CSS布局以后該在什么時(shí)候使用TABLE?
- IE6的雙倍邊距BUG
- CSS標(biāo)識(shí)當(dāng)前位置頁(yè)效果的實(shí)現(xiàn)原理
- 如何在CSS中寫腳本實(shí)現(xiàn)交互效果?
猜你也喜歡看這些
- 用css網(wǎng)站布局之十步實(shí)錄!(一)
- 10個(gè)很酷的涂鴉風(fēng)格國(guó)外網(wǎng)店設(shè)計(jì)展示
- CSS菜單:由CSS滑動(dòng)門技術(shù)實(shí)現(xiàn)的菜單十一款
- CSS實(shí)例教程:紅藍(lán)炫CSS橫向菜單
- CSS實(shí)例:區(qū)分IE6、IE7、FF對(duì)HR解釋的CSShack
- CSS布局實(shí)例:margin優(yōu)化的一種思路
- CSS布局的8個(gè)你需要掌握的技巧
- DIV CSS布局入門示例(一)頁(yè)面布局與規(guī)劃
- CSS實(shí)例:無懈可擊的CSS圓角技術(shù)!
- CSS去除表格td默認(rèn)間距及制作1px細(xì)線表格
- 相關(guān)鏈接:
- 教程說明:
Div+CSS教程-初始化CSS元素。