宅配料理トップページ作成

unsplash.com
テキスト
foodie.
ホーム
メニュー
プラン
料金
店舗
朝は、
手軽で美味しい
朝食を
プランを 1 つ選択し、配達時間を入力すると 、
家から出ることなくおいしい料理をお楽しみいただけます。
今すぐ注文
詳細を見る
twitter
Instagram
YouTube
© foodie.
制作ポイント(要件定義)
- 画像は、ブラウザを広げても container よりはみ出て見えるように(ネガティブマージン)
- 書体「font-family: "Montserrat", "Noto Sans JP", sans-serif;」
- 明朝体は「serif(汎用書体名)」指定

完成例
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>【コーディング練習】宅配朝食サービス</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Noto+Sans+JP:wght@100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="header">
<div class="container">
<h1 class="logo"><a href="#">foodie.</a></h1>
<nav class="gnav">
<ul>
<li><a href="#" class="current">ホーム</a></li>
<li><a href="#">メニュー</a></li>
<li><a href="#">プラン</a></li>
<li><a href="#">料金</a></li>
<li><a href="#">店舗</a></li>
</ul>
</nav>
</div>
</header>
<main class="main">
<section class="hero">
<div class="container">
<div class="description">
<h2>朝は、<br>手軽で美味しい<br>朝食を</h2>
<p>プランを 1 つ選択し、配達時間を入力すると
、<br>家から出ることなくおいしい料理をお楽しみいただけます。</p>
<ul class="cta">
<li><a href="#">今すぐ注文</a></li>
<li><a href="#">詳細を見る</a></li>
</ul>
</div>
<div class="main_visual">
<img src="img/main.webp" alt="">
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="container">
<ul>
<li><a href="#">twitter</a></li>
<li><a href="#">Instagram</a></li>
<li><a href="#">YouTube</a></li>
</ul>
<p class="copy"><small>© foodie.</small></p>
</div>
</footer>
</body>
</html>
@charset "UTF-8";
*, *::before, *::after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
ul {
list-style: none;
}
a {
color: inherit;
text-decoration: none;
}
img {
max-width: 100%;
vertical-align: bottom;
}
body {
background-color: #fff;
color: #333;
font-size: 16px;
font-family: "Montserrat", "Noto Sans JP", sans-serif;
line-height: 1.7;
overflow-x: hidden;
}
.container {
width: min(90%, 1240px);
margin: 0 auto;
}
.header {
width: 100%;
height: auto;
padding: 30px 0 50px;
}
header > .container {
display: flex;
align-items: center;
justify-content: space-between;
}
.header h1 {
color: #0f9969;
font-size: 44px;
font-weight: 700;
}
.gnav > ul {
display: flex;
justify-content: center;
}
.gnav li {
font-size: 18px;
font-weight: 700;
letter-spacing: 0.1em;
}
.gnav li > a {
display: block;
padding: 6px 16px;
}
.gnav li > a:hover, .current {
background-color: #0f9969;
color: #fff;
}
.main {
margin-bottom: 70px;
}
.hero > .container {
display: flex;
gap: 40px;
}
.description {
width: 42%;
}
.description h2 {
font-size: 44px;
font-family: serif;
font-weight: 700;
line-height: 1.3;
margin-bottom: 25px;
}
.description p {
font-size: 18px;
margin-bottom: 35px;
}
.cta {
display: flex;
}
.cta li a {
display: inline-block;
padding: 8px 26px;
border: 2px solid #076343;
border-radius: 50px;
font-weight: 600;
transition-duration: .3s;
}
.cta li:first-child a {
background-color: #076343;
color: #fff;
margin: 0 15px 10px 0;
}
.cta li:first-child a:hover {
background-color: #0f9969;
border: 2px solid #0f9969;
color: #fff;
}
.cta a:last-child:hover {
background-color: #fff;
border: 2px solid #fff;
color: #222222;
box-shadow: 0 0 10px #21212160;
}
.main_visual {
width: 78%;
margin-right: -20%;
}
.main_visual > img {
width: 100%;
height: 70vh;
object-fit: cover;
object-position: left bottom;
}
.footer ul {
display: flex;
justify-content: center;
margin-bottom: 10px;
}
.footer li > a {
display: block;
padding: 2px 16px 0;
border-bottom: 2px solid transparent;
color: #0f9969;
}
.footer li > a:hover {
border-bottom: 2px solid #0f9969;
}
.copy {
text-align: center;
}