가오리의 코딩일기

[2주차] 2022 여름방학 HTML & CSS 세미나2 본문

HTML+CSS+JavaScript/세미나

[2주차] 2022 여름방학 HTML & CSS 세미나2

류경혜 2022. 7. 20. 17:00

<!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>Robot</title>
    <link rel="stylesheet" href="./style.css" />
  </head>
  <body>
    <article class="red_robot">
      <section>
        <img src="./img/robot-red.png" alt="Cars" />
        <div>
          <h1>RED</h1>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quod,
            corporis blanditiis earum porro maiores ratione.
          </p>
        </div>
      </section>
      <footer>
        <a href="https://www.youtube.com/watch?v=8quCMBWbauA">LAUNCH</a>
      </footer>
    </article>
    <article class="green_robot">
      <section>
        <img src="./img/robot-green.png" alt="Androboi" />
        <div>
          <h1>GREEN</h1>
          <p>
            Lorem ipsum dolor, sit amet consectetur adipisicing elit. Numquam
            dolores dolore voluptatibus odio consequatur quis?
          </p>
        </div>
      </section>
      <footer>
        <a href="https://www.youtube.com/watch?v=WIgFjRQBuo0">LAUNCH</a>
      </footer>
    </article>
    <article class="blue_robot">
      <section>
        <img src="./img/robot-blue.png" alt="Doraemon" />
        <div>
          <h1>BLUE</h1>
          <p>
            Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iste rem
            ipsa natus laudantium nam amet?
          </p>
        </div>
      </section>
      <footer>
        <a href="https://www.youtube.com/watch?v=6zmxzJFZxMI">LAUNCH</a>
      </footer>
    </article>
  </body>
</html>
body {
  margin: 0;
  padding: 0;
  background-color: rgb(92, 92, 92);
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
article {
  width: 300px;
  height: 350px;
  background-color: white;
  color: rgb(180, 180, 180);
  text-align: center;
  margin-top: 200px;
}
img {
  width: 200px;
  margin-top: -230px;
}
h1 {
  display: inline-block;
  font-size: 30px;
}
section {
  height: 280px;
}
/* each class */
.green_robot {
  margin-left: 20px;
  margin-right: 20px;
}
.red_robot h1 {
  background-color: rgb(255, 238, 199);
  border-top: 5px solid tomato;
  border-bottom: 5px solid tomato;
  color: tomato;
}

.green_robot h1 {
  background-color: rgb(255, 238, 199);
  border-top: 5px solid rgb(71, 170, 48);
  border-bottom: 5px solid rgb(71, 170, 48);
  color: rgb(71, 170, 48);
}
.blue_robot h1 {
  background-color: rgb(255, 238, 199);
  border-top: 5px solid rgb(71, 114, 255);
  border-bottom: 5px solid rgb(71, 114, 255);
  color: rgb(71, 114, 255);
}
/* footer */
footer {
  height: 70px;
  background-color: rgb(199, 199, 199);
  display: flex;
  justify-content: center;
  align-items: center;
}
a {
  width: 100px;
  height: 30px;
  line-height: 30px;
  text-decoration: none;
  font-size: 18px;
  color: white;
}
/* each class a */
.red_robot a {
  background-color: tomato;
  border-bottom: 3px solid rgb(183, 70, 50);
}
.green_robot a {
  background-color: rgb(71, 170, 48);
  border-bottom: 3px solid rgb(48, 114, 33);
}
.blue_robot a {
  background-color: rgb(71, 114, 255);
  border-bottom: 3px solid rgb(52, 84, 188);
}
.red_robot a:active,
.green_robot a:active,
.blue_robot a:active {
  margin-bottom: -5px;
  border-bottom: none;
}