:html로 뼈대를 잡아 문서에 style을 입혀 줌
h1{
color : red;
}
/* 주석 표시할 내용 */
: 특정 HTML 태그에 스타일을 적용하는 법
h1{
color: blue;
font-size:36px;
}
p{
color: green;
font-family: Arial, sans-serif;
line-height: 1.5;
}
ul{
list-style-type: square;
margin-left: 20px;
}
a{
text-decoration: none;
color: darkred;
}
| 속성 | 설명 |
|---|---|
| font-family | 글꼴 |
| font-size | 글자 크기 |
| font-weight | 글자 두께 |
| font-style | 글자 스타일 |
: 특정 클래스에 속한 HTML 요소에 스타일 적용
.highlight{
color: orange;
font-weight: bold;
}
.intro{
font-size: 20px;
font-family: "Arial", sans-serif;
}
.footer{
background-color: #f1f1f1;
padding: 10px;
text-align: center;
}
: 특정 HTML 요소에 대해 고유한 스타일을 적용할 때 사용됨
#main-title{
color: blue;
font-size: 40px;
text-align: center;
}
#header{
background-color: lightblue;
padding: 20px;
}
#footer{
background-color: darkgray;
color: white;
text-align: center;
padding: 10px
}