実力に見合わないと知りながら、
Airbnbの模写コーディングに挑戦中です。
上のヘッダー内の右側の「はじめる」のボタンは
div要素です。
なんとかデザインをつけることには成功をしたのですが、
ヘッダーの上下中央に配置する事ができません。
align-items: center;
align-content: center;
など試しましたが動きません、、、。
よろしくお願いします。
HTML
1<!DOCTYPE html> 2<html lang="ja"> 3<head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 <link rel="stylesheet" href="css/style.css"> 7 8 <title>Document</title> 9</head> 10<body> 11 <header> 12 <section class="header-wrapper"> 13 <ul> 14 <li><img src="img/airblogo.png"></li> 15 <li><a href="#">概要</a></li> 16 <li><a href="#">準備</a></li> 17 <li><a href="#">安全</a></li> 18 <li><a href="#">マネープラン</a></li> 19 </ul> 20 <div class="btn">はじめる<div/> 21 22 </section> 23 </header> 24 25 <section class="main-visual"> 26 27 </section> 28 29 30 <section class="form"> 31 32 </section> 33 34 <section class="text-content"> 35 36 </section> 37 38 39</body> 40</html>
CSS
1 2body{ 3 width:100%; 4 margin:0; 5} 6 7a{ 8 text-decoration: none; 9} 10 11li{ 12 list-style: none; 13} 14 15.header-wrapper ul li img{ 16 width:30px 17} 18 19.header-wrapper{ 20 display:flex; 21 justify-content: space-between; 22 height: 50px; 23} 24 25.header-wrapper ul{ 26 display:flex; 27 28} 29 30.header-wrapper ul li{ 31 margin: 0 20px; 32} 33 34.header-wrapper .btn{ 35 width:80px; 36 height:25px; 37 text-align: center; 38 background:#DB3742; 39 color: white; 40 font-weight: bold; 41 border-radius: 4px; 42 align-items: center; 43 /* justify-content: center; */ 44} 45 46.main-visual{ 47 height: 500px; 48 background-image: url("../img/header.jpg"); 49 background-size: cover; 50} 51
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/05/09 12:11