Search

0100_css선택자

대분류
CSS1
소분류
CSS1
영상
개념
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> /* CSS 선택자(selector) 1. 태그 선택자 2. 클래스 선택자 3. 아이디 선택자 4. 그룹 선택자 */ h1, h2 { color: red; } .blue-h1 { color: blue; } #yellow-h1 { color: yellow; } </style> </head> <body> <h1>Hello, CSS</h1> <h1 class="blue-h1">Hello, CSS</h1> <h1 class="blue-h1">Hello, CSS</h1> <h1 class="blue-h1">Hello, CSS</h1> <h1 id="yellow-h1">Hello, CSS</h1> <h2>Hello, CSS</h2> </body> </html>
HTML
복사