こんにちは。お世話になります。
現象
ヘッダーの左のロゴとテキストが縦並びになっています。
期待値
ヘッダーの左のロゴとテキストをCSS gridかFlexboxを使って横並びにしたいです。
再現方法
index.htmlとstylesheet.cssを同じディレクトリに置き、index.htmlをブラウザで開いていただければ再現できます。
OS:Ubuntu Mate 19.10
ブラウザ:Google Chrome最新版
模写しているサイトは下記のサイトになります。ロゴの画像は著作権の問題で省略させていただきます。
iSara[イサラ]バンコクのノマドエンジニア育成講座
index
1 <header> 2 <div class="title"> 3 <div> 4 <img class="header-logo" src="/assets/isaralogo.png" alt=""> 5 <p class="header-text">バンコクのノマドエンジニア講座</p> 6 </div> 7 </div> 8 <div class="header-button-wrapper"> 9 <div class="header-button-text-wrapper"> 10 <a href=""> 11 お問い合わせ / 資料請求はこちら 12 </a> 13 </div> 14 </div> 15 </header>
css
1@charset "UTF-8"; 2 3/* 基本設定 */ 4 5* { 6 margin: 0; 7} 8 9/* ヘッダー */ 10 11header { 12 display: grid; 13 grid-template-columns: 14 200px 1fr 1fr 200px; 15 grid-template-rows: 16 [header-top] 15px 17 [header-middle] 40px 18 [header-bottom] 15px; 19} 20 21.title { 22 grid-column: 2 / -3; 23 grid-row: header-middle; 24 display: flex; 25 justify-content: center; 26 align-items: center; 27} 28 29.title-wrapper { 30 height: 40px; 31 margin: 20px; 32} 33 34.header-logo { 35 height: 40px; 36} 37 38.header-text { 39 font-size: 15px; 40 font-weight: bold; 41} 42 43.header-button-wrapper { 44 display: flex; 45 justify-content: center; 46 align-items: center; 47 grid-column: 3 / -2; 48 grid-row: header-middle; 49} 50 51.header-button-text-wrapper { 52 display: flex; 53 justify-content: center; 54 align-items: center; 55 border-radius: 50px; 56 font-size: 15px; 57 height: 40px; 58 width: 320px; 59} 60 61.header-button-text-wrapper a { 62 padding: 12.5px 45px; 63 border-radius: 50px; 64 font-size: 12px; 65 text-decoration: none; 66 background-color: #da6b64; 67 color: white; 68}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2020/05/14 17:30
退会済みユーザー
2020/05/15 21:02