html 훈련 - (1) Ad Banner

frenchkebab·2021년 10월 19일
0

Ad Banner


HTML 마크업


HTML 코드

<div class="modal">
  <h1>
    Unlimited downloads.<br />
    Our best content. No attribution.
  </h1>
  <p>
    As low as $9/mo<br />
    Buy subscription or credit packs
  </p>
  <a href="#" target="_blank">Join Pro</a>
</div>

결과 화면

우선 이렇게 HTML 뼈대를 잘 세우는 것이 중요하다!


CSS 입히기


css 넣어주기

AdBanner.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./styles.css" />
    <title>Ad Banner</title>
  </head>
  <body>
    <div class="modal">
      <h1>
        Unlimited downloads.<br />
        Our best content. No attribution.
      </h1>
      <p>
        As low as $9/mo<br />
        Buy subscription or credit packs
      </p>
      <a href="#" target="_blank">Join Pro</a>
    </div>
  </body>
</html>

styles.css

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

html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
    'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1f2d3d;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  margin: 0 auto;
  background-color: #1f2d3d;
}

body::after {
  content: 'frenchkebab©';
  display: block;
  margin-top: 50px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.modal {
  position: relative;
  flex-grow: 0;
  flex-shrink: 0;
  padding: 40px 36px 36px;
  border-radius: 12px;
  background-color: #fff;
  transition: box-shadow 250ms ease-in, transform 250ms ease-in;
}

.modal:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3);
}

h1 {
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #474747;
}

p {
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  letter-spacing: 0.01em;
}

a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 320px;
  height: 65px;
  border-radius: 6px;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: linear-gradient(90deg, #ff8806 0%, #fb07f3 100%);
}

결과 화면

CSS만 잘 입히면 얼마든지 디자인적 요소를 이렇게 넣어줄 수 있다.
우선은 시멘틱한 HTML 마크업에 먼저 신경쓰자!

profile
Blockchain Dev Journey

0개의 댓글