見出し画像

WEBサイト コーディング トレーニング③「headerのコーディング」

 <header class="header">
     <h1 class="site-title">HAMOI</h1>
     <p class="site-description">perfume store</p>
 </header>
<h>タグの決まり

・<h1>タグはページに1つ。メインコンテンツに配置する。
・<h1>タグには必ずターゲットキーワードを含める。
・<h1>〜<h6> htmlに記述する順番を守る。
・<h1>を画像に設定する場合、alt属性をきちんと設定すること。
 隠しテキストについては、モダンコーディング P.037を確認。

・テキストを強調するタグ<strong>や、
 同様に<em>を使用してはいけない。

<h2>冬は<strong>とても</strong>寒い<h2> 

・<p>タグの中に、<h>タグを入れてはいけない。
 <p>タグの中はインライン要素のみ。
・<h>タグの中はインライン要素のみ。


ヘッダーのCSSはこのように。

/* ---ヘッダー--- */
.header {
    padding: 260px 0;
}
.site-title{
    text-align: center;
    margin-bottom: 0;
}
.site-description{
    text-align: center;
    margin-top: 0;
}