1. ホーム
  2. Web制作
  3. HTML/Xhtml

html タグのデフォルトスタイルの照合順序

2022-01-15 04:44:12
html, address,blockquote,body, dd, div,dl, dt, fieldset, form,frame, frameset,h1, h2, h3, h4,h5, h6, noframes,ol, p, ul, center,dir, hr, menu, pre { display: block }/*上記のリスト要素はデフォルトでブロックとして表示し、表示しないものはインライン要素として表示します、このリストは HTML4 版です、XHTML1 ではいくつかの要素は非推奨*/*となる予定です。
li { display: list-item }/*デフォルトではリストとして表示されます*/。
head { display: none }/*デフォルトでは表示されません*/。
table { display: table }/*デフォルトでテーブル表示*/
tr { display: table-row }/*default to table-row display*/
thead { display: table-header-group }/*default to table-header-group display*/
tbody { display: table-row-group }/*default to table-row-group display*/
tfoot { display: table-footer-group }/*default to table-bottom-group display*/
col { display: table-column }/*default to table-column display*/
colgroup { display: table-column-group }/*default to table-column-group display*/
td, th { display: table-cell; }/*デフォルトはセル表示*/。
caption { display: table-caption }/*デフォルトは table-caption 表示*/です。
th { font-weight: bolder; text-align: center }/*デフォルトは table-caption で、太字と中央揃えにレンダリングされます*/。
caption { text-align: center }/*デフォルトはテーブルキャプション、中央揃えで表示 */。
body { margin: 8px; line-height: 1.12 }.
h1 { font-size: 2em; margin: 0.67em 0 }.
h2 { font-size: 1.5em; margin: 0.75em 0 }.
h3 { font-size: 1.17em; margin: 0.83em 0 }.
h4, p, blockquote, ul, fieldset, form, ol, dl, dir, menu { margin: 1.12em 0 }.
h5 { font-size: .83em; margin: 1.5em 0 }.
h6 { font-size: .75em; margin: 1.67em 0 }.
h1, h2, h3, h4, h5, h6, b,strong { font-weight: bolder }.
blockquote { margin-left: 40px; margin-right: 40px }.
i, cite, em,var, address { font-style: italic }.
pre, tt, code, kbd, samp { font-family: monospace }.
pre { white-space: pre }.
button, textarea, input, object, select { display:inline-block; }.
big { font-size: 1.17em }.
small, sub, sup { font-size: .83em }.
sub { vertical-align: sub }/*デフォルトで添え字として表示するsub要素を定義*/。
sup { vertical-align: super }/*デフォルトで上付きになるようにsub要素を定義します*/。
table { border-spacing: 2px; }.
thead, tbody, tfoot { vertical-align: middle }/*テーブルヘッダー、ボディテーブル、フッター要素をデフォルトで縦に揃えるように定義*/
td, th { vertical-align: inherit }/*セル、カラムヘッダのデフォルトの垂直配向を継承 */
s, strike, del { text-decoration: line-through }/*これらの要素をデフォルトで取り消し線として表示するように定義する */
hr { border: 1px inset }/*分割線をデフォルトで1px幅の3D凹エッジ効果にすることを定義します*/。
ol, ul, dir, menu, dd { margin-left: 40px }.
[...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...] [...]
また、このような書き方もあります。
コピーコード
コードは以下の通りです。

body {
margin:0;
padding:0;
}

ラージブラウザのデフォルトのフォントサイズは中と同じ16pxで、h1~h6要素はデフォルトでブロックとして太字で表示されます。
タイトルスタイルをクリアするには、一般的に
コピーコード
コードは以下の通りです。

p {
margin-top:0;
margin-bottom:0;
}

4. リストスタイル
IEのデフォルトは40pxで、ul, olのmarginプロパティで設定します。
FFのデフォルトは40pxで、ul, olのpaddingプロパティで設定します。
dlにはインデントがありませんが、中の説明要素ddはデフォルトで40pxのインデントで始まり、名前要素dtにはインデントがありません。
リストスタイルをクリアするには、一般的に
コピーコード
コードは以下の通りです。

h1 {font-size:xx-large;}
h2 {font-size:x-large;}
h3 {font-size:large;}
h4 {font-size:medium;}
h5 {font-size:small;}
h6 {font-size:x-small;}

5. 要素のセンタリング
IEのデフォルトはtext-align:centerです。
FFのデフォルトは、margin-left:auto;margin-right:autoです。
6. ハイパーリンクのスタイル
デフォルトで下線付きのスタイル、表示色は青、訪問したハイパーリンクは紫になり、リンクスタイルをクリアするには、一般的に設定できます。
コピーコード
コードは以下の通りです。

hx {
font-weight:normal;
font-size:value;
}

7種類のマウススタイル
IEのデフォルトはcursor:handです。
FFのデフォルトはcursor:pointer;です。この宣言は、IEでも有効です
8種類の画像リンクスタイル
IEのデフォルトは紫色の2pxのボーダーラインです。
FFのデフォルトは青の2pxのボーダーライン
画像リンクのスタイルをクリアするには、一般的に
img {
border:0です。
}