본문 바로가기
Web/HTML | CSS|JAVASCRIPT

Linear Gradients 그라데이션 적용하기(CSS)

by 싸공 2020. 7. 27.
<!DOCTYPE html>
<html>
<head>
<style>
div{
  floatleft;
  width200px;
  height200px;
  margin5px;
}
.grad1 {
  background-colorred
  background-imagelinear-gradient(redyellow);
}
.grad2 {
  background-colorred
  background-imagelinear-gradient(to leftgreenblue);
}
.grad3 {
  background-colorred
  background-imagelinear-gradient(to bottom rightredyellow);
}
.grad4 {
  background-colorred
  background-imagelinear-gradient(redyellowblue);
}
.grad5 {
  background-colorred
  background-imagelinear-gradient(to leftred,orange,yellow,green,blue,indigo,violet);
}
</style>
</head>
<body>
<div class="grad1"></div>
<div class="grad2"></div>
<div class="grad3"></div>
<div class="grad4"></div>
<div class="grad5"></div>

</body>
</html>



background-image: linear-gradient(방향, 색상1, 색상2, ....);

'Web > HTML | CSS|JAVASCRIPT' 카테고리의 다른 글

폰트 어썸(Font Awesome) 사용법  (0) 2020.07.28
overflow 정리(CSS)  (0) 2020.07.27
opacity 정리(CSS)  (0) 2020.07.27
Shadow 정리(CSS)  (0) 2020.07.27
border-radius 정리(CSS)  (0) 2020.07.27