예시)
<!doctype html> <html> <head> <title>FIFA World Cup</title> <meta charset="utf-8"> </head> <body> <h1><a href="index.html"><font color="Green">FIFA World Cup</font></a></h1> <ol> <li><a href="1.html"><font color="Green">FIFA World Cup</font></a></li> <li><a href="2.html"><font color="Green">Format</font></a></li> <li><a href="3.html"><font color="Green">All-time table for champions</font></a></li> # 스타일을 추가하고 싶은 곳마다 스타일 속성을 부여 </ol> <h2>FIFA World Cup</h2> <a href="https://en.wikipedia.org/wiki/FIFA_World_Cup" target="_blank"> The <u>FIFA World Cup</u></a>, often simply called the World Cup, is an <strong>international association football competition contested</strong> by the senior men's national teams of the members of the Fédération Internationale de Football Association (FIFA, the International Federation of Association Football), the sport's global governing body. 중략 </body> </html>
<!doctype html> <html> <head> <title>FIFA World Cup</title> <meta charset="utf-8"> <style> a { color:green; } /* a 태그를 선택자(selector)로 이용 */ </style> </head> <body> <h1><a href="index.html">FIFA World Cup</a></h1> <ol> <li><a href="1.html">FIFA World Cup</a></li> <li><a href="2.html">Format</a></li> <li><a href="3.html">All-time table for champions</a></li> </ol> <!--> <h1><a href="index.html"><font color="Green">FIFA World Cup</font></a></h1> <ol> <li><a href="1.html"><font color="Green">FIFA World Cup</font></a></li> <li><a href="2.html"><font color="Green">Format</font></a></li> <li><a href="3.html"><font color="Green">All-time table for champions</font></a></li> </ol> --> <h2>FIFA World Cup</h2> <a href="https://en.wikipedia.org/wiki/FIFA_World_Cup" target="_blank"> The <u>FIFA World Cup</u></a>, often simply called the World Cup, is an <strong>international association football competition contested</strong> by the senior men's national teams of the members of the Fédération Internationale de Football Association (FIFA, the International Federation of Association Football), the sport's global governing body. 중략 </body> </html>
<style> a { color:green; text-decoration: none; } </style>
<!doctype html> <html> <head> <title>FIFA World Cup</title> <meta charset="utf-8"> <style> a { color:black; } .saw { color:gray; } .active { color:red; } h1 { font-size:35px; text-align: center; } </style> </head> <body> <h1><a href="index.html">FIFA World Cup</a></h1> <ol> <li><a href="1.html" class="saw">FIFA World Cup</a></li> <li><a href="2.html" class="saw active">Format</a></li> <li><a href="3.html">All-time table for champions</a></li> </ol>
CSS 선택자
태그 선택자(Type Selector): a {}
클래스 선택자(Class Selector): .class {}
아이디 선택자(ID Selector): #id {}
전체 선택자(Universal Selector): * {}
<!doctype html> <html> <head> <title>FIFA World Cup</title> <meta charset="utf-8"> <style> a { color:black; } #active { color:red; } .saw { color:gray; } h1 { font-size:35px; text-align: center; } </style> </head> <body> <h1><a href="index.html">FIFA World Cup</a></h1> <ol> <li><a href="1.html" class="saw">FIFA World Cup</a></li> <li><a href="2.html" class="saw" id="active">Format</a></li> <li><a href="3.html">All-time table for champions</a></li> </ol>