<!--

    1.img 태그를 사용하여 이미지 콘텐츠를 저장 :하이퍼링크가 있다

    2.배경 속성을 사용하여 배경 이미지로 저장 :하이퍼링크가 없다

 

    ※배경 속성

    background: 배경색상 배경이미지반복여부(repeat, repeat-x, repeat-y) 배경위치(left/center/right top/center/bottom);

    background-attachment:fixed; 배경이미지를 고정

    background-size:cover; 배경이미지를 박스크기로 확장

 

    ※벤더 프리픽스 :브랜드 접두사 >크로스 브라우징

    1. 크롬:-webkit-

    2.사파리:-webkit-

    3.파이어 폭스:-moz-

    4.오페라:-o-

    5.인터넷 익스플로러:-ms-

-->

<!DOCTYPE html>

<html lang="ko">

<head>

<meta charset="utf-8">

<title>배경속성</title>

<style>

    * {margin:0padding:0box-sizingborder-box

    @import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&display=swap');

    @import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&display=swap');

    h1h2h3h4 h5h6 { font-family'Abril Fatface', cursive; }

    body { font-family'Roboto Condensed'sans-serif;font-size:15pxcolor#333background:#a7b1a3 url(./imgs/back-sample1.jpgrepeat-y center; }



    header {width100%height70pxbackgroundwhite;}

    header img { height:40pxmargin:15px 0 0 50px;}



    section { width:1000pxmargin:0 auto; }

    .bn { position:relativewidth100%height200pxbackground#000 url(./imgs/chess.jpgno-repeat left center;}

    .bn h2 { 

        position:absoluteright50pxtop:80px

        font-size:92pxcolor#fff;text-transformcapitalize; }

    .fix { 

        height:300pxmargin:200px 0padding:25px 0

        backgroundurl(./imgs/ipad.jpgno-repeat center

        background-attachmentfixed;

        background-sizecover;

         }

    .fix p {

        width500pxheight250px

        margin:0 auto;

        padding20px;

        color:#fff

        backgroundrgba(0,0,0,0.7);

        }

 

        .gradient {

            width:300pxheight100pxmargin200px auto;

            backgroundlinear-gradient( to leftsalmon 0%skyblue 50%wheat 100%);

            border-radius50px;

        }

        

        .repeat-linear-gradient {

            width300pxheight200pxmargin150px auto;

            backgroundrepeating-linear-gradient(#daff#daff 20px#adff 35px#ddaf 50px);

        }

        .repeat-radial-gradient {

            width600pxheight600pxmargin150px auto;

            text-align:center;

            background:repeating-radial-gradient(#daff#daff 20px#adff 35px#ddaf 50px);

        }

        .repeat-radial-gradient img {margin-top60px;}

 

        .box1 {width200pxheight200pxmargin50px auto;

        backgroundurl(./imgs/office.jpg);background-sizecover;}

 

        .colorzilla {

            width500pxheight150pxmargin300px auto;

            /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#afabe8+0,ffbcbc+31,bcf5ff+68,faffbc+100 */

        backgroundrgb(175,171,232); /* Old browsers */

        background-moz-linear-gradient(-45deg,  rgba(175,171,232,10%rgba(255,188,188,131%rgba(188,245,255,168%rgba(250,255,188,1100%); /* FF3.6-15 */

        background-webkit-linear-gradient(-45deg,  rgba(175,171,232,10%,rgba(255,188,188,131%,rgba(188,245,255,168%,rgba(250,255,188,1100%); /* Chrome10-25,Safari5.1-6 */

        backgroundlinear-gradient(135deg,  rgba(175,171,232,10%,rgba(255,188,188,131%,rgba(188,245,255,168%,rgba(250,255,188,1100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */

        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#afabe8', endColorstr='#faffbc',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */}

 

</style>

</head>

<body>

    <header>

        <a href="#"><img src="./imgs/delion.png"></a>

    </header>

 

    <section>

        <div class="bn"><h2>chess</h2></div>

        <div class="fix">

            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nisl tincidunt eget nullam non. Quis hendrerit dolor magna eget est lorem ipsum dolor sit. Volutpat odio facilisis mauris sit amet massa. Commodo odio aenean sed adipiscing diam donec adipiscing tristique. Mi eget mauris pharetra et. Non tellus orci ac auctor augue. Elit at imperdiet dui accumsan sit. Ornare arcu dui vivamus arcu felis. Egestas integer eget aliquet nibh praesent. In hac habitasse platea dictumst quisque sagittis purus. Pulvinar elementum integer enim neque volutpat ac.

            </p>

        </div>

        <div class="gradient"></div>

        <div class="repeat-linear-gradient"></div>

        <div class="repeat-radial-gradient">

            <img src="./imgs/logo.png">

            <div class="box1"></div>

            <div class="colorzilla"></div>

        </div>

        

    </section>

</body>

</html>

--------------------------------- Parallax Scrolling

<!DOCTYPE html>

<html lang="ko">

<head>

<meta charset="utf-8">

<title></title>

<style>

* { margin:0padding:0box-sizing:border-box; }

body { height15000px; }

 .bg {

     height100vh

     backgroundurl(./imgs/bg.jpgno-repeat center;

     background-sizecover;

 }

 .small-bg {

     positionabsolutetop:50%width100%height200pxmargin-top-100px;

     backgroundurl(./imgs/bg.jpgno-repeat center;

     background-attachmentfixed;

     background-sizecover;

 }

 .bg h2 { positionabsolutetop:80%width100%font-size:95pxcolor:#ffftext-aligncentertext-transformuppercase;}

</style>

</head>

 

<body>

    <div class="bg">

        <div class="small-bg"></div>

        <h2>fox</h2>

    </div>

 

</body>

</html>

'Coding' 카테고리의 다른 글

CSS 선수학습(9)  (0) 2021.07.21
CSS 복습/실습  (0) 2021.07.20
CSS 선수학습(7)  (0) 2021.07.16
CSS 선수학습(6)  (0) 2021.07.15
CSS 선수학습(5)  (0) 2021.07.14

+ Recent posts