2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

コピペでそれっぽいFlexboxなヘッダー

Posted at

メモ書き程度の記事です。

display: flex;とちょっとのCSSでできるそれっぽいヘッダー

用意するもの

  • HTMLファイル
  • CSSファイル
  • エディタ

コピペ本文

header.html
<header>
  <nav>
    <ul>
      <li><a href="/">ロゴ</a></li>
      <li><a href="#">メニューA</a></li>
      <li><a href="#">メニューB</a></li>
      <li><a href="#">メニューC</a></li>
    </ul>
  </nav>
</header>

これに

header.css
ul {
  display: flex;
}

ul li {
  padding: 10px 20px;
}

ul li:first-child {
  margin-right: auto;
}

おしまい。
display: flex;はすごい!!

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?