萬盛學電腦網

 萬盛學電腦網 >> 網頁制作 >> DivCSS教程 >> 浏覽器默認HTML的CSS樣式屬性是啥

浏覽器默認HTML的CSS樣式屬性是啥

大家知道浏覽器默認HTML的CSS樣式屬性嗎?下面我們就給大家詳細介紹一下吧!

這個“浏覽器默認HTML的CSS樣式屬性”,在你需要還原默認值的時候,比較有用。開始的時候應用通配選擇器 *{margin:0;padding:0;},當需要使用邊距的時候,就需要還原HTML默認CSS值了。

但通配選擇器在大型網站的構建中,影響性能,可以參考52CSS.com的相關文章,大家還是需要謹慎一些。

以前一直在找這份文檔,今天偶然在w3上看到了。除了inline和block的定義,主要是要注意body|h1~h6|blockquote|menu|ul|ol|dd等標簽的默認樣式(margin和font-size)。

html, address, <BR>blockquote, <BR>body, dd, div, <BR>dl, dt, fieldset, form, <BR>frame, frameset, <BR>h1, h2, h3, h4, <BR>h5, h6, noframes, <BR>ol, p, ul, center, <BR>dir, hr, menu, pre { display: block } <BR>li { display: list-item } <BR>head { display: none } <BR>table { display: table } <BR>tr { display: table-row } <BR>thead { display: table-header-group } <BR>tbody { display: table-row-group } <BR>tfoot { display: table-footer-group } <BR>col { display: table-column } <BR>colgroup { display: table-column-group } <BR>td, th { display: table-cell; } <BR>caption { display: table-caption } <BR>th { font-weight: bolder; text-align: center } <BR>caption { text-align: center } <BR>body { margin: 8px; line-height: 1.12 } <BR>h1 { font-size: 2em; margin: .67em 0 } <BR>h2 { font-size: 1.5em; margin: .75em 0 } <BR>h3 { font-size: 1.17em; margin: .83em 0 } <BR>h4, p, <BR>blockquote, ul, <BR>fieldset, form, <BR>ol, dl, dir, <BR>menu { margin: 1.12em 0 } <BR><BR>h5 { font-size: .83em; margin: 1.5em 0 } <BR>h6 { font-size: .75em; margin: 1.67em 0 } <BR>h1, h2, h3, h4, <BR>h5, h6, b, <BR>strong { font-weight: bolder } <BR>blockquote { margin-left: 40px; margin-right: 40px } <BR>i, cite, em, <BR>var, address { font-style: italic } <BR>pre, tt, code, <BR>kbd, samp { font-family: monospace } <BR>pre { white-space: pre } <BR>button, textarea, <BR>input, object, <BR>select { display:inline-block; } <BR>big { font-size: 1.17em } <BR>small, sub, sup { font-size: .83em } <BR>sub { vertical-align: sub } <BR>sup { vertical-align: super } <BR>table { border-spacing: 2px; } <BR>thead, tbody, <BR>tfoot { vertical-align: middle } <BR>td, th { vertical-align: inherit } <BR>s, strike, del { text-decoration: line-through } <BR>hr { border: 1px inset } <BR>ol, ul, dir, <BR>menu, dd { margin-left: 40px } <BR>ol { list-style-type: decimal } <BR>ol ul, ul ol, <BR>ul ul, ol ol { margin-top: 0; margin-bottom: 0 } <BR>u, ins { text-decoration: underline } <BR>br:before { content: "\A" } <BR>:before, :after { white-space: pre-line } <BR><BR>center { text-align: center } <BR>abbr, acronym { font-variant: small-ca<a href="http://www.duote.com/soft/808.html" target="_blank"><span style="color:#0020ff">ps</span></a>; letter-spacing: 0.1em } <BR>:link, :visited { text-decoration: underline } <BR>:focus { outline: thin dotted invert } <BR><BR>/* Begin bidirectionality settings (do not change) */ <BR>BDO[DIR="ltr"] { direction: ltr; unicode-bidi: bidi-override } <BR>BDO[DIR="rtl"] { direction: rtl; unicode-bidi: bidi-override } <BR><BR>*[DIR="ltr"] { direction: ltr; unicode-bidi: embed } <BR>*[DIR="rtl"] { direction: rtl; unicode-bidi: embed } <BR><BR>@media print { <BR>h1 { page-break-before: always } <BR>h1, h2, h3, <BR>h4, h5, h6 { page-break-after: avoid } <BR>ul, ol, dl { page-break-before: avoid } 

相信大家已經學會浏覽器默認HTML的CSS樣式屬性了吧!感謝大家對我們網站的支持!

相關推薦:

div css語法的縮寫的方法 

copyright © 萬盛學電腦網 all rights reserved