λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
HTML5 & CSS3

[HTML5 & CSS3] μ‹€μŠ΅ - 고양이 λΆ„μ–‘ νŽ˜μ΄μ§€ λ§Œλ“€κΈ°

by μ½”λ”©ν•˜λŠ” λΆ•μ–΄ 2021. 2. 15.
λ°˜μ‘ν˜•

쑰건) 이미지 μ΅œμ†Œ 3μž₯ 이상. ν…μŠ€νŠΈ: ν’ˆμ’…, 성별, λ‚˜μ΄, λΆ„μ–‘κ°€

​

​

<λ‚΄κ°€ ν•œ 것>

마우슀 올리면 μ €λ ‡κ²Œ 뜨게!

 

<μ†ŒμŠ€>

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>고양이 λΆ„μ–‘</title>
<style>
   * {
      margin: 0; /* μ™ΈλΆ€ μ—¬λ°± */
      padding: 0; /* ν…Œλ‘λ¦¬μ™€ λ‚΄μš© μ‚¬μ΄μ˜ μ—¬λ°± */
      box-sizing: border-box;
   }
   #container {
      width: 100%; /* λ„ˆλΉ„ */
   }
   header {
      width: 100%; /* λ„ˆλΉ„ */
      height: 80px; /* 높이 */
      margin: 0; /* μ™ΈλΆ€ μ—¬λ°± */
   }
   a {
      text-decoration: none; /* κΈ€μž 꾸밈 */
   } 
   nav {
      height: 50px; /* 높이 */
      background:skyblue; /* λ°°κ²½ 색 */
   }
   #main-nav {
      list-style: none;
      margin-bottom: 10px;
      padding: 10px; /* ν…Œλ‘λ¦¬μ™€ λ‚΄μš© μ‚¬μ΄μ˜ μ—¬λ°± */
      text-align: center;
   }
   #main-nav li {
      display: inline-block;    
      color: #fff;
      font-family: "맑은 κ³ λ”•", 돋움;
      font-size: 0.9em;
      margin: 5px 15px; /* μ™ΈλΆ€ μ—¬λ°± */
   }
   nav a:link, a:visited {
      color: #fff;
   }
   nav > ul > li {
      width: 15%; /* λ„ˆλΉ„ */
      height: 40px; /* 높이 */
      margin-top: 30px; /* μš”μ†Œ μ£Όλ³€ μ—¬λ°± */
      position:relative; /* μ›λž˜ μžμ‹ μ΄ μžˆμ–΄μ•Όλ  μœ„μΉ˜λ₯Ό κΈ°μ€€μœΌλ‘œ 배치 */
      float:center; /* μ •λ ¬ */
   }
   nav > ul > li > a {
      display: block; /* ν˜•νƒœ */
      width: 25%px; /* λ„ˆλΉ„ */
      height: 40px; /* 높이 */
      text-align: center; /* κ°€μš΄λ° μ •λ ¬ */
      line-height: 40px; /* 쀄 간격 */
      font-size: 18px; /* κΈ€μž 크기 */
      color:black /* κΈ€μž 색 */
   }
   nav > ul > li > a:hover {
      background-color: gray; 
      color: floralwhite;
   } 
   #menus {
      width: 100%; /* λ„ˆλΉ„ */      
   }
   #menus > div {
      height: 400px; /* 높이 */
      margin-bottom: 10px; /* μš”μ†Œ μ£Όλ³€ μ—¬λ°± */
      position: relative;
   }
   #menu1, #menu2, #menu3, #menu4, #menu5 {
      width: 100%; /* λ„ˆλΉ„ */
   }
   #menus h4 {
      position: absolute;
      padding: 5px; /* ν…Œλ‘λ¦¬μ™€ λ‚΄μš© μ‚¬μ΄μ˜ μ—¬λ°± */
      font-size: 20px;
      color:white;
      text-shadow: 3px 3px 5px black;
      right: 3%;
      bottom: 10px;
   }
   #menu1 {
      background:url("cat1.png") no-repeat center;
      background-size: cover;
   }
   #menu2 {
      background:url("cat2.png") no-repeat center;
      background-size: cover;
   }
   #menu3 {
      background:url("cat3.png") no-repeat center;
      background-size: cover;
   }
   #menu4 {
      background:url("cat4.png") no-repeat center;
      background-size: cover;
   }
   #menu5 {
      background:url("cat5.png") no-repeat center;
      background-size: cover;
   }
   footer {
      width: 100%; /* λ„ˆλΉ„ */
      background:#373737; /* λ°°κ²½ 색 */
      height: 200px; /* 높이 */
   }
   footer p {
      font-size: 1.2em; /* κΈ€μž 크기 */
      color:#eee; /* 색깔 */
      text-align: center; /* κ°€μš΄λ° μ •λ ¬ */
      line-height: 200px; /* 쀄 간격 */
   }

   @media all and (min-width:768px) {
      #menus {
         display: flex; /* ν”Œλ ‰μ„œλΈ” λ°•μŠ€ λ ˆμ΄μ•„μ›ƒ 적용 */
         -ms-flex-wrap: wrap;
         -webkit-flex-wrap: wrap;
         flex-wrap: wrap; /* μ—¬λŸ¬ 쀄에 걸쳐 ν‘œμ‹œ */
         justify-content: space-between; /* ν™”λ©΄ μ–‘μͺ½μ— 바짝 뢙이기  */
      }
      #menu1, #menu2, #menu3, #menu4 {
         width: 49%; /* λ„ˆλΉ„ */
      }
      #menu5 {
         width: 100%; /* λ„ˆλΉ„ */
      }
   }

   @media all and (min-width:992px) {
      #menu1, #menu2, #menu3, #menu4, #menu5 {
         width: 33%; /* λ„ˆλΉ„ */
      }
      #menu5 {
         margin-left: 0.5%; /* μš”μ†Œ μ£Όλ³€ μ—¬λ°± */
         -ms-flex: 2 2 0;
         -webkit-flex: 2 2 0;
         flex: 2 2 0;
      }
   }

   .button {
      cursor: pointer;
      background: #000; /* λ°°κ²½ */
      text-decoration: none; /* κΈ€μž 꾸밈 */
      color: #666; /* 색깔 */
   }

   .curl-top-left {
      display: inline-block; /* ν˜•νƒœ */
      position: relative; /* μ›λž˜ μžμ‹ μ΄ μžˆμ–΄μ•Όλ  μœ„μΉ˜λ₯Ό κΈ°μ€€μœΌλ‘œ 배치 */
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
      transform: translateZ(0);
      box-shadow: 0 0 1px rgba(0, 0, 0, 0);
   }
​
   .curl-top-left:before {
      pointer-events: none;
      position: absolute;
      content: '';
      height: 0; /* 높이 */
      width: 0; /* λ„ˆλΉ„ */
      top: 0;
      left: 0;
      background: white; /* λ°°κ²½ */
   /* IE9 */
      background: linear-gradient(135deg, white 45%, #aaa 50%, #ccc 56%, white 80%);
      filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ffffff', endColorstr='#000000');
   /*For IE7-8-9*/
      z-index: 1000;
      box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); /* λ°•μŠ€ 그림자 */
      transition-duration: 0.3s;
      transition-property: width height;
   }
​
   .curl-top-left:hover:before {
      width: 16px; /* λ„ˆλΉ„ */
      height: 16px; /* 높이 */
   }
​
   #menu1:hover, #menu2:hover, #menu3:hover, #menu4:hover, #menu5:hover {
      opacity: 0.2;
      -moz-transform: translateY(0px);
      -ms-transform: translateY(0px);
      -o-transform: translateY(0px);
      -webkit-transform: translateY(0px);
      transform: translateY(0px);
   }            
</style>
</head>
<body>
<div id="container">
<header>
<nav>
   <ul id="main-nav">
      <li><a href='#'><b>μ‚¬μ΄νŠΈ μ†Œκ°œ</b></a></li>          
      <li><a href='#'><b>고양이 λΆ„μ–‘</b></a></li>
      <li><a href='#'><b>고양이 μžλž‘</b></a></li>
      <li><a href='#'><b>고객센터</b></a></li>
   </ul>
</nav>
</header>
<section id="menus">
   <div id="menu1">
      <h4>
         ν’ˆμ’… : λŸ¬μ‹œμ•ˆλΈ”λ£¨<br>
         성별 : 남<br>
         λ‚˜μ΄ : 1μ‚΄<br>
         λΆ„μ–‘κ°€ : 100λ§Œμ›
      </h4>
   </div>
   <div id="menu2">
      <h4>
         ν’ˆμ’… : 아메리칸 μˆν—€μ–΄<br>
         성별 : μ—¬<br>
         λ‚˜μ΄ : 3κ°œμ›”<br>
         λΆ„μ–‘κ°€ : 50λ§Œμ›
      </h4>
   </div>
   <div id="menu3">
      <h4>
         ν’ˆμ’… : μ½”λ¦¬μ•ˆ μˆν—€μ–΄<br>
         성별 : 남<br>
         λ‚˜μ΄ : 2μ‚΄<br>
         λΆ„μ–‘κ°€ : 5λ§Œμ›
      </h4>
   </div>
   <div id="menu4">
      <h4>
         ν’ˆμ’… : 페λ₯΄μ‹œμ•ˆκ³ μ–‘이<br>
         성별 : 남<br>
         λ‚˜μ΄ : 1μ‚΄<br>
         λΆ„μ–‘κ°€ : 1000λ§Œμ›
      </h4>
   </div>
   <div id="menu5">
      <h4>
         ν’ˆμ’… : λΈŒλ¦¬ν‹°μ‰¬μˆν—€μ–΄<br>
         성별 : 남<br>
         λ‚˜μ΄ : 1μ‚΄<br>
         λΆ„μ–‘κ°€ : 20λ§Œμ›
      </h4>
   </div>
</section>
</div>
</body>
</html>
λ°˜μ‘ν˜•

λŒ“κΈ€