Ini ialah cadangan gaya HTML4 organisasi w3c Malangnya, penyemak imbas telah menambah atribut peribadi mereka sendiri, meninggalkan standard dalam gelap. Tetapi ia masih mempunyai kepentingan rujukan yang besar kepada kami.
Lampiran D. Helaian gaya lalai untuk HTML 4
Lampiran ini bermaklumat, bukan normatif.
Helaian gaya ini menerangkan pemformatan biasa bagi semua elemen HTML 4 ([HTML4]) berdasarkan penyelidikan meluas ke dalam amalan UA semasa digalakkan untuk menggunakannya sebagai helaian gaya lalai dalam pelaksanaan mereka
Pembentangan penuh beberapa elemen HTML tidak boleh dinyatakan dalam CSS 2.1, termasuk elemen yang digantikan ("img". "objek "), elemen skrip ("skrip", "applet"), elemen kawalan bentuk dan elemen bingkai
Untuk elemen lain, pembentangan warisan boleh diterangkan dalam CSS tetapi penyelesaiannya mengalih keluar elemen tersebut. Sebagai contoh, elemen FONT boleh digantikan dengan melampirkan pengisytiharan CSS pada elemen lain (cth., DIV Begitu juga, persembahan warisan atribut pembentangan (cth., atribut "sempadan" pada JADUAL) boleh diterangkan dalam CSS, tetapi penanda dalam). dokumen sumber mesti ditukar
<code class="css">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, <span class="value"><font color="#0000ff">center</font></span>, <br>dir, hr, menu, <span class="value"><font color="#0000ff">pre</font></span> { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">block</font></span> } <br>li { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">list-item</font></span> } <br>head { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">none</font></span> } <br>table { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: table } <br>tr { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-row</font></span> } <br>thead { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-header-group</font></span> } <br>tbody { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-row-group</font></span> } <br>tfoot { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-footer-group</font></span> } <br>col { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-column</font></span> } <br>colgroup { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-column-group</font></span> } <br>td, th { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-cell</font></span> } <br><span class="value"><font color="#0000ff">caption</font></span> { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">table-caption</font></span> } <br>th { <span class="attrib"><strong><font color="#000080">font-weight</font></strong></span>: <span class="value"><font color="#0000ff">bolder</font></span>; <span class="attrib"><strong><font color="#000080">text-align</font></strong></span>: <span class="value"><font color="#0000ff">center</font></span> } <br><span class="value"><font color="#0000ff">caption</font></span> { <span class="attrib"><strong><font color="#000080">text-align</font></strong></span>: <span class="value"><font color="#0000ff">center</font></span> } <br>body { <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: <span class="number"><font color="#ff0000">8px</font></span> } <br>h1 { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: <span class="number"><font color="#ff0000">2em</font></span>; <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: .<span class="number"><font color="#ff0000">67em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h2 { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: <span class="number"><font color="#ff0000">1.5em</font></span>; <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: .<span class="number"><font color="#ff0000">75em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h3 { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: <span class="number"><font color="#ff0000">1.17em</font></span>; <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: .<span class="number"><font color="#ff0000">83em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h4, p, <br>blockquote, ul, <br>fieldset, form, <br>ol, dl, dir, <br>menu { <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: <span class="number"><font color="#ff0000">1.12em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h5 { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: .<span class="number"><font color="#ff0000">83em</font></span>; <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: <span class="number"><font color="#ff0000">1.5em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h6 { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: .<span class="number"><font color="#ff0000">75em</font></span>; <span class="attrib"><strong><font color="#000080">margin</font></strong></span>: <span class="number"><font color="#ff0000">1.67em</font></span> <span class="number"><font color="#ff0000">0</font></span> } <br>h1, h2, h3, h4, <br>h5, h6, b, <br>strong { <span class="attrib"><strong><font color="#000080">font-weight</font></strong></span>: <span class="value"><font color="#0000ff">bolder</font></span> } <br>blockquote { <span class="attrib"><strong><font color="#000080">margin-left</font></strong></span>: <span class="number"><font color="#ff0000">40px</font></span>; <span class="attrib"><strong><font color="#000080">margin-right</font></strong></span>: <span class="number"><font color="#ff0000">40px</font></span> } <br>i, cite, em, <br>var, address { <span class="attrib"><strong><font color="#000080">font-style</font></strong></span>: <span class="value"><font color="#0000ff">italic</font></span> } <br><span class="value"><font color="#0000ff">pre</font></span>, tt, <span class="value"><font color="#0000ff">code</font></span>, <br>kbd, samp { <span class="attrib"><strong><font color="#000080">font-family</font></strong></span>: monospace } <br><span class="value"><font color="#0000ff">pre</font></span> { <span class="attrib"><strong><font color="#000080">white-space</font></strong></span>: <span class="value"><font color="#0000ff">pre</font></span> } <br>button, textarea, <br>input, select { <span class="attrib"><strong><font color="#000080">display</font></strong></span>: <span class="value"><font color="#0000ff">inline</font></span>-<span class="value"><font color="#0000ff">block</font></span> } <br>big { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: <span class="number"><font color="#ff0000">1.17em</font></span> } <br><span class="value"><font color="#0000ff">small</font></span>, <span class="value"><font color="#0000ff">sub</font></span>, sup { <span class="attrib"><strong><font color="#000080">font-size</font></strong></span>: .<span class="number"><font color="#ff0000">83em</font></span> } <br><span class="value"><font color="#0000ff">sub</font></span> { <span class="attrib"><strong><font color="#000080">vertical-align</font></strong></span>: <span class="value"><font color="#0000ff">sub</font></span> } <br>sup { <span class="attrib"><strong><font color="#000080">vertical-align</font></strong></span>: <span class="value"><font color="#0000ff">super</font></span> } <br>table { <span class="attrib"><strong><font color="#000080">border-spacing</font></strong></span>: <span class="number"><font color="#ff0000">2px</font></span>; } <br>thead, tbody, <br>tfoot { <span class="attrib"><strong><font color="#000080">vertical-align</font></strong></span>: <span class="value"><font color="#0000ff">middle</font></span> } <br>td, th, tr { <span class="attrib"><strong><font color="#000080">vertical-align</font></strong></span>: inherit } <br>s, strike, del { <span class="attrib"><strong><font color="#000080">text-decoration</font></strong></span>: <span class="value"><font color="#0000ff">line-through</font></span> } <br>hr { <span class="attrib"><strong><font color="#000080">border</font></strong></span>: <span class="number"><font color="#ff0000">1px</font></span> <span class="value"><font color="#0000ff">inset</font></span> } <br>ol, ul, dir, <br>menu, dd { <span class="attrib"><strong><font color="#000080">margin-left</font></strong></span>: <span class="number"><font color="#ff0000">40px</font></span> } <br>ol { <span class="attrib"><strong><font color="#000080">list-style-type</font></strong></span>: <span class="value"><font color="#0000ff">decimal</font></span> } <br>ol ul, ul ol, <br>ul ul, ol ol { <span class="attrib"><strong><font color="#000080">margin-top</font></strong></span>: <span class="number"><font color="#ff0000">0</font></span>; <span class="attrib"><strong><font color="#000080">margin-bottom</font></strong></span>: <span class="number"><font color="#ff0000">0</font></span> } <br>u, ins { <span class="attrib"><strong><font color="#000080">text-decoration</font></strong></span>: <span class="value"><font color="#0000ff">underline</font></span> } <br>br:before { <span class="attrib"><strong><font color="#000080">content</font></strong></span>: <span class="string"><font color="#008080">"\A"</font></span>; <span class="attrib"><strong><font color="#000080">white-space</font></strong></span>: <span class="value"><font color="#0000ff">pre</font></span>-line } <br><span class="value"><font color="#0000ff">center</font></span> { <span class="attrib"><strong><font color="#000080">text-align</font></strong></span>: <span class="value"><font color="#0000ff">center</font></span> } <br>:link, :visited { <span class="attrib"><strong><font color="#000080">text-decoration</font></strong></span>: <span class="value"><font color="#0000ff">underline</font></span> } <br>:focus { <span class="attrib"><strong><font color="#000080">outline</font></strong></span>: <span class="value"><font color="#0000ff">thin</font></span> <span class="value"><font color="#0000ff">dotted</font></span> <span class="value"><font color="#0000ff">invert</font></span> } <br> <br><span class="mlcom"><font color="#4040c2">/* Begin bidirectionality settings (do not change) */</font></span> <br>BDO[DIR=<span class="string"><font color="#008080">"ltr"</font></span>] { <span class="attrib"><strong><font color="#000080">direction</font></strong></span>: <span class="value"><font color="#0000ff">ltr</font></span>; <span class="attrib"><strong><font color="#000080">unicode-bidi</font></strong></span>: <span class="value"><font color="#0000ff">bidi-override</font></span> } <br>BDO[DIR=<span class="string"><font color="#008080">"rtl"</font></span>] { <span class="attrib"><strong><font color="#000080">direction</font></strong></span>: <span class="value"><font color="#0000ff">rtl</font></span>; <span class="attrib"><strong><font color="#000080">unicode-bidi</font></strong></span>: <span class="value"><font color="#0000ff">bidi-override</font></span> } <br> <br>*[DIR=<span class="string"><font color="#008080">"ltr"</font></span>] { <span class="attrib"><strong><font color="#000080">direction</font></strong></span>: <span class="value"><font color="#0000ff">ltr</font></span>; <span class="attrib"><strong><font color="#000080">unicode-bidi</font></strong></span>: <span class="value"><font color="#0000ff">embed</font></span> } <br>*[DIR=<span class="string"><font color="#008080">"rtl"</font></span>] { <span class="attrib"><strong><font color="#000080">direction</font></strong></span>: <span class="value"><font color="#0000ff">rtl</font></span>; <span class="attrib"><strong><font color="#000080">unicode-bidi</font></strong></span>: <span class="value"><font color="#0000ff">embed</font></span> } <br> <br>@media <span class="value"><font color="#0000ff">print</font></span> { <br> h1 { <span class="attrib"><strong><font color="#000080">page-break-before</font></strong></span>: <span class="value"><font color="#0000ff">always</font></span> } <br> h1, h2, h3, <br> h4, h5, h6 { <span class="attrib"><strong><font color="#000080">page-break-after</font></strong></span>: <span class="value"><font color="#0000ff">avoid</font></span> } <br> ul, ol, dl { <span class="attrib"><strong><font color="#000080">page-break-before</font></strong></span>: <span class="value"><font color="#0000ff">avoid</font></span> } <br>}</code>