뉴비코더
나는 코딩뉴비
뉴비코더
전체 방문자
오늘
어제
  • 분류 전체보기 (91)
    • 개발입문뉴비 - 국비지원 ( Front End ) (91)
      • html (26)
      • css (58)
      • javascript (6)
      • Library React.js (0)
    • FrontEnd ( Self-study ) (0)
      • html5, CSS3 (0)
      • Vanilla JS (0)
      • Clone Code (0)
    • BackEnd ( self-study ) (0)
      • Library Node.js (0)
      • Python (0)
      • Go (0)

블로그 메뉴

  • 홈
  • 방명록

공지사항

인기 글

태그

  • boxmodel
  • HTML
  • HTML5
  • 클론코딩
  • 웹개발
  • 국비지원
  • css3
  • Margin
  • ol
  • js 이벤트객체
  • transform
  • position
  • 코딩진화
  • Transition
  • 가상클래스
  • js event object
  • js 생성 함수
  • boxmodeling
  • 마크업
  • Javascript 배열
  • 웹개발입문
  • JavaScript
  • webfont
  • 하이퍼링크
  • parseInt
  • padding
  • js event
  • psuedo-class
  • UL
  • 프론트엔드

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
뉴비코더

나는 코딩뉴비

[2021/12/29]국비지원 CSS3 9-(1) gradient
개발입문뉴비 - 국비지원 ( Front End )/css

[2021/12/29]국비지원 CSS3 9-(1) gradient

2022. 2. 1. 03:21

 

 

 

 

gradient : 그라디언트

 

 

gradient property

  1. linear-gradient : 선형 그라디언트
    • background-image : linear-gradient ()
      • setting ( direction = deg )
        • linear-gradient ( to direction, start color, end color )
        • linear-gradient ( deg, start color, end color )
        • linear-gradient ( to direction, first color n%, nth color n%, last color n% )
      • direction : start ( direction ) or end ( to direction )
        • top
        • left
        • bottom
        • right
        • top left ( 45deg )
        • top right ( 135deg )
        • bottom left ( 135deg )
        • bottom right ( 45deg )
  2. radial-gradient : 방사형 gradient
    • radial-gradient : ( shape, start color, end color )
      radial-gradient : ( size at x y, start color, end color ) 
      • shape
        • eclipse : 타원 ( default )
        • circle : 원
      • size at x, y
        • closest-side contain : 가장 가까운 모서리에 닿음
        • closest-corner : 가장 가까운 코너에 닿음
        • farthest-side : 가장 멀리 있는 모서리에 닿음
        • farthest-corner ( default ) : 가장 멀리 있는 코너에 닿음
      • positon : center ( default )

 


 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        div{width:200px;height:200px;}
        .grad1{background: #f00;background:linear-gradient(to bottom,#f00,#00f);}
        /* 방향 top left bottom right topleft 45deg 시작
            to bottom, to right, to bottom right 45deg 끝 */
        .grad2{background: #f00;background:linear-gradient(to bottom right,#f00,#00f);}
        .grad3{background: #f00;background:linear-gradient(45deg,#f00,#0f0,#00f);}
        .grad4{background: #f00;background:linear-gradient(45deg,red 0%,orange 10%,yellow 25%,green 40%,blue 60%,navy 80%,purple 100%);}
        /* 기본 eclipse(타원),그 다음 원형 */
        .grad5{background: #f00;width:500px;height:300px;background:radial-gradient(#f00 0%,#0f0 50%,#00f 100%);}
        .grad6{background: #f00;width:500px;height:300px;background:radial-gradient(circle,#f00 0%,#0f0 50%,#00f 100%);}
        /* closest-side contain 그라데이션이 가장 가까운 면과 만남
            closest-corner 가장 가까운 코너와 만남
            farthest-side 가장 멀리 있는 면과 만남
            farthest-corner 가장 멀리 있는 코너와 만남*/
        .grad7{background: #f00;width:500px;height:300px;background:radial-gradient(closest-side at 30% 30%,red,yellow,green);}
        .grad8{background: #f00;width:500px;height:300px;background:radial-gradient(closest-corner at 30% 30%,red,yellow,green);}
        .grad9{background: #f00;width:500px;height:300px;background:radial-gradient(farthest-side at 30% 30%,red,yellow,green);}
        .grad10{background: #f00;width:500px;height:300px;background:radial-gradient(farthest-corner at 30% 30%,red,yellow,green);}
        /* repeat */
        .grad11{background:repeating-linear-gradient(yellow 0px,yellow 20px,red 20px,red 40px);}
        .grad12{background:repeating-radial-gradient(yellow,yellow 20px,red 20px,red 40px);}
        /* 그라디언트 자동생성 사이트 : http://www.colorzilla.com/graddient-editor */
        .grad13{width:370px;height:50px;border-radius: 8px;
                background: -moz-linear-gradient(top, #cb60b3 0%, #c146a1 32%, #a80077 69%, #db36a4 100%); /* FF3.6-15 */
                background: -webkit-linear-gradient(top, #cb60b3 0%,#c146a1 32%,#a80077 69%,#db36a4 100%); /* Chrome10-25,Safari5.1-6 */
                background: linear-gradient(to bottom, #cb60b3 0%,#c146a1 32%,#a80077 69%,#db36a4 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */}
    </style>
</head>
<body>
    <h1>그라데이션</h1>
    <div class="grad1"></div>
    <div class="grad2"></div>
    <div class="grad3"></div>
    <div class="grad4"></div>
    <div class="grad5"></div>
    <div class="grad6"></div>
    <div class="grad7"></div>
    <div class="grad8"></div>
    <div class="grad9"></div>
    <div class="grad10"></div>
    <div class="grad11"></div>
    <div class="grad12"></div>
    <div class="grad13"></div> 
</body>
</html>

 

 


 

결과물

저작자표시 비영리 변경금지 (새창열림)
    '개발입문뉴비 - 국비지원 ( Front End )/css' 카테고리의 다른 글
    • [2021/12/29]국비지원 CSS3 9-(3) 과제1 + 버튼
    • [2021/12/29]국비지원 CSS3 9-(2) rgb, rgba, hsl, hsla, opacity
    • [2021/12/27]국비지원 CSS3 8-(5) shadow
    • [2021/12/27]국비지원 CSS3 8-(4) border-image
    뉴비코더
    뉴비코더
    FrontEnd 지망 - 코딩뉴비를 위한(?), 뉴비에 의한, 뉴비의 블로그 - 코딩뉴비의 코딩 학습 기록 - 첨가물 : 약간의 불평/사족

    티스토리툴바