๐Ÿ’œ HTML,CSS

HTML&CSS 17์ผ์ฐจ (์ •๋ฆฌx)

Genie_. 2024. 3. 23. 22:09
728x90
๋ฐ˜์‘ํ˜•
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>์„ ํ˜•/์›ํ˜• ๊ทธ๋ผ๋ฐ์ด์…˜</title>
</head>
<style>
  div {
    display: inline-block; /* inline์œผ๋กœ๋งŒํ•˜๋ฉด width height ๊ฐ’ ์•ˆ๋จน์Œ */
    width: 500px;
    height: 300px;
    border-radius: 10px;
  }
  .grad1{
    background-color: blue;
    /* (0,0)์ด ๊ธฐ์ค€์ด๋‹ˆ, ์˜ค๋ฅธ์ชฝ ๋ฐ‘์œผ๋กœ blue์—์„œ white๋กœ ๊ทธ๋ผ์ด์–ธํŠธ ๋งŒ๋“ค์–ด๋ผ */
    background: linear-gradient(to right bottom, lightblue, lightgoldenrodyellow);
  }
  .grad2{
    background-color: green;
    /* deg: ๊ฐ๋„. 45deg => 45๋„ => ์˜ค๋ฅธ์ชฝ ์œ„ ๋ฐฉํ–ฅ */
    background: linear-gradient(45deg, lightpink, mediumpurple);
  }
  .grad3{
    background-color: red;
    /* 30% ์œ„์น˜์— ์ƒ‰์ƒ ์ค‘์ง€์ ์„ ์ง€์ •ํ•œ๋‹ค */
    background: linear-gradient(to bottom, yellowgreen,lightgoldenrodyellow 50%, aquamarine);
  }

  /***********************************************/

  .rad1{
    background-color: mediumpurple;
    /* ํƒ€์›ํ˜•์œผ๋กœ ํฐ์ƒ‰, ๋…ธ๋ž€์ƒ‰, ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ๋ฐ”๋€Œ๋Š” ์›ํ˜• ๊ทธ๋ผ๋ฐ์ด์…˜ */
    background: radial-gradient(white, lightyellow, indianred);
  }
  .rad2{
    background-color: mediumpurple;
    /* ์›ํ˜•์œผ๋กœ ํฐ์ƒ‰, ๋…ธ๋ž€์ƒ‰, ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ๋ฐ”๋€Œ๋Š” ์›ํ˜• ๊ทธ๋ผ๋ฐ์ด์…˜ */
    background: radial-gradient(circle ,white, lightyellow, indianred);
  }
  .rad3{
    background-color: mediumpurple;
    /*
      closest-side : ๊ทธ๋ผ๋ฐ์ด์…˜ ์ค‘์‹ฌ์—์„œ ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ์ธก๋ฉด์— ๋‹ฟ์„ ๋•Œ๊นŒ์ง€
      closest-corner: ๊ทธ๋ผ๋ฐ์ด์…˜ ์ค‘์‹ฌ์—์„œ ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ๊ผญ์ง“์ ์— ๋‹ฟ์„ ๋•Œ๊นŒ์ง€
      farthest-side: ๊ทธ๋ผ๋ฐ์ด์…˜ ์ค‘์‹ฌ์—์„œ ๊ฐ€์žฅ ๋ฉ€๋ฆฌ ๋–จ์–ด์ง„ ์ธก๋ฉด์— ๋‹ฟ์„ ๋•Œ๊นŒ์ง€
      farthest-corner: ๊ทธ๋ผ๋ฐ์ด์…˜ ์ค‘์‹ฌ์—์„œ ๊ฐ€์žฅ ๋ฉ€๋ฆฌ ๋–จ์–ด์ง„ ๊ผญ์ง“์ ์— ๋‹ฟ์„ ๋•Œ๊นŒ์ง€
     */
    background: radial-gradient(closest-side, white, lightyellow, palevioletred);
  }
  .rad4{
    /* 20%์—์„œ ์‹œ์ž‘ํ•ด์„œ ํฐ์ƒ‰์—์„œ ํŒŒ๋ž€์ƒ‰์œผ๋กœ ๋ฐ”๋€Œ๋Š” ์›ํ˜• ๊ทธ๋ผ๋ฐ์ด์…˜ */
    /* ๊ฐ€์šด๋ฐ์—์„œ ์‹œ์ž‘ํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์ค‘์‹ฌ ์œ„์น˜๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. */
    background: radial-gradient(circle at 20% 20%, ghostwhite, cornflowerblue);
  }

  /*************************************************************/

  .pat1{
    background: repeating-linear-gradient(yellow, palevioletred 50px, palevioletred 20px, darkred 20px);
  }
  .pat2{
    background: repeating-linear-gradient(black, black 20px, white 20px, white 40px);
  }

</style>
<body>
  <section>
    <div class="grad1"></div>
    <div class="grad2"></div>
    <div class="grad3"></div>
  </section>
  <section>
    <div class="rad1"></div>
    <div class="rad2"></div>
    <div class="rad3"></div>
    <div class="rad4"></div>
  </section>
  <section>
    <div class="pat1"></div>
    <div class="pat2"></div>
  </section>
</body>
</html>

728x90
๋ฐ˜์‘ํ˜•