[CSS]embedding방식, link방식, inline방식

suyeon·2022년 8월 25일
1

CSS

목록 보기
1/6
post-thumbnail

CSS(Cascading Style Sheets)

  • css를 사용하면 유지보수가 편하고, 예쁘다는 장점이 있다.

embedding스타일

<style type="text/css">			
	H1{
		font-family : 굴림체;
		color : white;
	}
	H2{
		font-family : 궁서체; 
		color : pink;
	}
 
 </style>

 </head>
 <body bgcolor="#400040">		
 
 <center>
 
 <h1>스타일 시트 적용하기</h1>
 <br><hr>
 <h2>embedding 스타일</h2>
 <br><hr>

 </center>

  • head 안에 css를 써야한다.
  • style 부분에서만 바꾸면 되서 편리하다.

<head>
  <title>Document</title>
	<link rel="stylesheet" type="text/css" href="sample.css">
 
 </head>
 <body>
  
 <center>
 
	<h1>스타일 시트 적용하기</h1>		
	<br><hr>
	<h2>link 스타일</h2>
	<br><hr>

 </center>
//이런 링크를 만들어서 여기서 글자체와 글자색깔을 한 번에 바 꿀 수 있다.
H1{
	font-family : 굴림체;
	color : while;
  }
H2{
	font-family : 궁서체; 
	color : pink;
  }

  • head부분에 링크 걸기
  • 링크로 걸면 링크에서 색깔만 바꾸면 되서 embedding 스타일보다 더 간편하다

inline 스타일

<h1 style="font-family:굴림체; color:blue">스타일 시트 적용하기</h1>
 <br><hr>
 <h2 style="font-family:궁서체; color:pink">inline 스타일</h2>
  • 하나만 색깔을 바꾸고 싶을 때

profile
📖개발블로그📖

0개의 댓글