HTML 에 CSS 적용방법
<div style="color:red; font-size:20px;">내용</div>
내부 스타일 시트 ( Internal Style Sheet )
HTML 문서 안의 <head>섹션에 <style>과 </style>
안에 CSS 코드를 넣는 방법입니다.
외부 스타일 시트 (Linking Style Sheet)
별도의 CSS 파일을 만들고 HTML 문서와 연결(링크) 하는 방법입니다.
<style>
/* css */
body {
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
color: skyblue;
}
/* 클래스 선언시 .을 붙여줌. */
.male{
color: rebeccapurple;
}
.female{
background-color: darkgray;
color: red;
}
/* id 선언시 #을 붙여줌. 유니크, 유일함. */
#ceo{
font-family: 'Courier New', Courier, monospace;
font-size: 200% ;
color: chartreuse;
}
</style>
A B -> Select B inside of A
A.className -> Select A with class
A,B -> selects all A and B elements.
우선순위 1순위..
2순위