1. CSS 문법
Selector {declaration ; declaration}
-> Selector {property: value; property: value;}
2. CSS 선택자 표기
| Selector | Example | Exaple Description |
| .class | .intro | "intro"라는 클래스명을 가진 선택자 전체 |
| #id | #firstname | "firstname"이라는 id명을 지난 선택자 전체 |
| * | * | 전체 요소를 선택자로 가짐 |
| element | p | p태그(요소) 전체 선택 |
| element, element, ... | div, p | div, p 태그 전체 선택 |
3. 3가 CSS 삽입 방법 (웹문서에 CSS 추가 방법 : 브라우져가 스타일 시트를 읽어 드릴때 스타일시트에 정보에 따라 html 문서를 포맷시킨다. )
| External CSS | <link rel="stylesheet" type="text/css" href="mystyle.css"> |
| Interal CSS | <style> body {background-color: linen; } </style> |
| Inline CSS | <p style="color:red;">This is a paragraph</p> |
4. CSS 적용 우선 순위'
4-1. Inline style (inside an HTML element)
4-2. External and internal style sheets (in the head section)
4-3. Browser default
'코딩' 카테고리의 다른 글
| CSS Borders (0) | 2020.03.28 |
|---|---|
| CSS Backgrounds (0) | 2020.03.28 |
| HTML Layouts (0) | 2018.12.27 |
| HTML block and Inline Elements (0) | 2018.11.16 |
| HTML <link> Tag (0) | 2018.11.13 |