8-4. CSS ๊ณ ๊ธ‰์„ ํƒ์ž ์—ฐ์Šต๋ฌธ์ œ 1,2

2021. 10. 15. 00:48ใ†HTML + CSS + JS

728x90

* ์—ฐ์Šต๋ฌธ์ œ 1

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>์—ฐ์Šต๋ฌธ์ œ 1</title>  
  <style>
    img {
      margin-right:50px;
      border:1px solid #ccc;
      box-shadow: 2px 2px 5px #ccc;
    }

    img:first-of-type {
      border: 2px solid red;
    }
  </style>
</head>
<body>
  <img src="images/1.jpg" alt="">
  <img src="images/2.jpg" alt="">
  <img src="images/3.jpg" alt="">
</body>
</html>

 

 

* ์—ฐ์Šต๋ฌธ์ œ 2

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>์—ฐ์Šต๋ฌธ์ œ 2</title>  
  <style>
    * {
      box-sizing: border-box;
    }
    .top-menu {
      margin:50px auto;
      padding:0;
      list-style:none;
      width:605px;
      height:35px;
      box-shadow:0 3px 4px #8b8b8b;
      background-color:#dadada;
    }
    .top-menu li {
      float:left;
      border-right:1px solid #929292;
    }
    .top-menu li a:link{
      color:black;
      text-decoration:none;
      text-align:center;
      display:block;
      width:100px;
      height:35px;
      line-height: 35px;
    }

    .top-menu li:last-child {
      border-right:none;      
    }

    .top-menu li:not(:last-child) a:hover {
      background-color: #555;
      color: #fff;
    }

    .top-menu li:last-child a:hover{
      background-color: #b30000;
      color: #fff;
    }
  </style>
</head>
<body>
  <nav>
    <ul class="top-menu">
      <li><a href="#">๋ฉ”๋‰ด1</a></li>
      <li><a href="#">๋ฉ”๋‰ด2</a></li>
      <li><a href="#">๋ฉ”๋‰ด3</a></li>
      <li><a href="#">๋ฉ”๋‰ด4</a></li>
      <li><a href="#">๋ฉ”๋‰ด5</a></li>
      <li><a href="#">๋ฉ”๋‰ด6</a></li>
    </ul>
   </nav>
</body>
</html>
728x90