Web白描

Webデザインの勉強 - 演習

課題07 Girly Style

課題07 Girly Style 完成例

記述ポイント
  • 文字を読みやすいバランスに変更

style.css

@charset "UTF-8";

/* ----------------------------------------
  reset
---------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
ul {
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  vertical-align: bottom;
}
html {
  font-size: 100%;
}


/* ----------------------------------------
  body
---------------------------------------- */
body {
  background-color: #fff;
  color: #333;
  font-size: 1.0rem;
  font-family: Arial, sans-serif;
  line-height: 1.0;
}


/* ----------------------------------------
  header
---------------------------------------- */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #fff;
  background-image: url(../img/bg_img.webp);
  background-repeat: no-repeat;
  background-position: left top;
  background-size: cover;
  color: #fff;
  font-family: serif;
  font-weight: bold;
  text-align: center;
}
  .header h1 {
    margin-bottom: 20px;
    font-size: 3.125rem;
  }
  .header p {
    font-size: 1.25rem;
  }

@media screen and (max-width: 767px) {
  .header h1 {
    margin-bottom: 10px;
    font-size: 2.5rem;
  }
  .header p {
    font-size: 1.0rem;
  }
}

index.html

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GIRLY SITE</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
  <header class="header">
    <div class="container">
      <h1>キュートな瞬間</h1>
      <p>あなたの心をつかむ、可愛いデザイン</p>
    </div><!-- /.container -->
  </header>
</body>
</html>