0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【CSSの基本】

Posted at

CSSの基本的な書き方。
セレクタにはデザイン変更の適用先を書く。プロパティのところには背景であったり、文字の大きさ等セレクタで指定された部分の何を変えるのかを決める。
値ではどのように見た目を変えるのかを書く。

セレクタ {
プロパティ:値
}

セレクタはa{〜}div{〜}img{〜}boby{~} 等のタグで指定する場合はそのまま書いていい。

boby{
プロパティ:値
}

idで指名する場合は、「#」を先頭につける

<CSS>
#headline{
プロパティ:値
}
<HTML>
<div id="headline">
  <h1>CSS入門</h1>
  <p>これは段落です。</p>
</div>
<div class="main">
  <h2>これは見出しです。</h2>
  <p>これは<span class="light"></span>です。</p>
  <p>
  <a href="https://saruwakakun.com/">ホームへ</a>
  戻ります。</p>
</div>

classで指名する際は「.」で書く

<CSS>
.headline{
プロパティ:値
}
<HTML>
<div class="headline">
  <h1>CSS入門</h1>
  <p>これは段落です。</p>
</div>
<div class="main">
  <h2>これは見出しです。</h2>
  <p>これは<span class="light"></span>です。</p>
  <p>
  <a href="https://saruwakakun.com/">ホームへ</a>
  戻ります。</p>
</div>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?