を発行した後、私は、私も::before
と::after
::擬似要素は
.menu-icon {
display: flex;
width: 40px;
height: 35px;
border: 1px solid black;
justify-content: center;
}
.menu-icon span {
background-color: black;
width: 35px;
height: 5px;
margin-top: 6px;
}
.menu-icon span::before {
content: "";
width: 35px;
height: 5px;
background-color: black;
}
.menu-icon span::after {
content: "";
width: 35px;
height: 5px;
background-color: black;
}
<div class="menu-icon">
<span></span>
</div>
の私ザッ理解した上で、本当に簡単だと思う何かをやろうとしている前と::。私はちょうど1つのdiv
と1つのspan
との単純な3つのバーのハンバーガーメニューを作成しようとしています。何らかの理由で、私は表示する1つのバーを得ることができ、それは元のspan
要素にあるバーです。 ::before
と::after
の私の理解で、それらのバーを作ることができるはずです。私が間違っている?そして私がそうでない場合、私のコードのどの部分がバーを疑似要素に表示していないのですか?
聖なる牛!どうもありがとうございます!私はcss-tricksに行き、私の前に::後にブラッシュアップする必要があります!私はあなたが許してすぐに答えをあげるよ! –