![見出し画像](https://assets.st-note.com/production/uploads/images/78141513/rectangle_large_type_2_1dce731d0a23a8dee782fe146591c7fd.jpeg?width=1200)
100日後にWebサイト作れるようになる納富 vol.2
今日はトップページの作成を途中までしました。
残り94日。
課題1:aタグの下線 青文字が消えない
原因:親要素にtext-decoration: none;を指定していた。
解決策:aタグに直接指定
参照元:https://note.com/stst_esty/n/nbb34e88c5ef4
修正前
.menu-item {
list-style: none;
display: inline-block;
padding: 10px;
color: black;
text-decoration: none;
}
修正後
.menu-item a {
text-decoration: none;
color: black;
}
![](https://assets.st-note.com/img/1652016441415-vBjaVCZxnc.png?width=1200)
課題2:margin: 0 auto;が効かない
原因:widthを指定していないから
解決策:結局、上下中央寄せにしたかったのでdisplay: flex;で作成
参照元:https://knowledge.cpi.ad.jp/tech/169/
修正前
.maintheme {
padding: 20px 0;
margin: 0 auto;
font-size: 50px;
font-family: Georgia, 'Times New Roman', Times, serif;
}
修正後
.maintheme {
display: flex;
justify-content: center;
align-items: center;
padding: 20px 0;
margin: 0 auto;
font-size: 50px;
font-family: Georgia, 'Times New Roman', Times, serif;
}
![](https://assets.st-note.com/img/1652017638128-86he56I8r8.png?width=1200)
課題3:トップの画像の表示位置をいい感じにしたい
方法:未解決(object-fitかobeject-position?)
![](https://assets.st-note.com/img/1652019629161-qvUeiTFSLw.png?width=1200)
続きはまた今度。
この記事が気に入ったらサポートをしてみませんか?