Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##クラス、idセレクタ
- ```html
- <article>
- <h1>タイトル</h1>
- <div>
- <p>本文</p>
- </div>
- </article>
- ```
- これを
- ```html
- <div>
- <h2>タイトル</h2>
- <div>
- <p>本文</p>
- </div>
- </div>
- ```
- へと、変更したくなった時に備えて、CSSは、
- ```css
- .entry-title {
- border-bottom: 2px solid #000;
- margin-bottom: 1em;
- padding: 10px;
- font-size: 24px;
- font-weight: bold;
- }
- ```
- としておく。
- ```css
- article h1 {
- border-bottom: 2px solid #000;
- margin-bottom: 1em;
- padding: 10px;
- font-size: 24px;
- font-weight: bold;
- }
- ```
- とかはダメ。つまり、HTMLタグを使ったセレクタを避ける。
Add Comment
Please, Sign In to add comment