私はHTMLとCSSが新しく、現在コーディングしているメニューに問題が発生しました。`justify-content`プロパティがネストされたフレックスボックスで動作しません
ネストフレックスボックスを使用してメニューを作成したいと思います。それは私が欲しいものに近づいていますが、私は理解できない理由で、子どもたちのフレキシボックス内のjustify-content
が適用されていないようです...ここで
は私のコードです:
header {
display: inline-flex;
height: 90px;
align-items: center;
justify-content: flex-start;
}
.avatar {
display: inline-flex;
height: inherit;
width: 200px;
background-color: #00D717;
align-items: center;
justify-content: space-around;
}
.avatar h1 {
font-size: 13px;
text-transform: uppercase;
color: white;
}
.resteHeader {
display: inline-flex;
height: inherit;
justify-content: flex-start;
align-items: center;
}
.resteHeader nav {
display: inline-flex;
height: inherit;
justify-content: space-around;
align-items: center;
}
.resteHeader nav ul {
display: inline-flex;
height: inherit;
justify-content: space-between;
align-items: center;
}
<header>
<div class="avatar">
<img src="img/avatar.png">
<h1>Hoang Nguyen</h1>
</div>
<div class="resteHeader">
<nav>
<ul>
<li>
<a href="#">
<img src="img/silhouette.png" alt="">
</a>
</li>
<li>
<a href="#">
<img src="img/bulle.png" alt="">
</a>
</li>
<li>
<a href="#">
<img src="img/cloche.png" alt="">
</a>
</li>
</ul>
</nav>
<img class="logo" src="img/logo.png" alt="">
<form>
Type sor search
<input type="text">
<img src="img/loupe.png" alt="">
</form>
</div>
</header>
ご協力いただきありがとうございます。
?期待される結果は何ですか? – Oriol
'' inline-flex''は、必要なだけ広い幅でコンテナを作ることを意味します。 'inline-flex'コンテナに' justify-content:space-around'を指定するのは意味がありません。(幅広い 'inline-flex'コンテナはそうではありません) – Adam
はインラインでは使用しません-felxはdisplayを使う:flex; – DanyCode