LoginSignup
0
0

More than 5 years have passed since last update.

横並びnavを作る3つの方法③flex

Posted at

最近の流行り?
対応していないブラウザーもあるので、要注意!

#nav03 {}
#nav03 ul {
    display:flex;
    background-color:#ccc;
    border: 1px solid #000;
    border-right: none; 


}
#nav03 ul li {
    width: 25%;
}
#nav03 ul li a {
    display: block;
    text-align: center;
    padding: 10px;
    border-right: 10px solid #000;
}
<nav id="nav03">
            <ul>
            <li><a href="#">たたかう</a></li>
            <li><a href="#">にげる</a></li>
            <li><a href="#">まほう</a></li>
            <li><a href="#">ぼうぎょ</a></li>
            </ul>
        </nav>

image.png

# 参考
https://www.webcreatorbox.com/tech/css-flexbox-cheat-sheet

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0