0
0

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 1 year has passed since last update.

CSSのスタイルについて

Posted at

ヘッダーを作ってみる①

htmlのコードはこんな感じ

index.html
   <div class="header">
      <div class="header-logo">Progate</div>
      <div class="header-list">
        <ul>
          <li>プログラミングとは</li>
          <li>学べるレッスン</li>
          <li>お問い合わせ</li>
        </ul>
      </div>
    </div>

まずは<li>の黒点を外すところから!

stylesheet.css
li {
 list-style: none;
}

これでリストの黒点を外すことができた。

次にリストの中身を横並びにする
floatプロパティを使うことで、指定した要素を横並びにすることができる。

stylesheet.css
li {
 list-style: none;
/*ここにfloatプロパティを追加*/
 float: left;
}

「float: left;」を使用することによって要素が左から順に横並びになる。

ロゴとリストを横並びにする

stylesheet.css
.header-logo{
  font-size: 36px;
  float: left;
}

<li>タグの黒点を外して横並びにするまでやってみました。
次回はこの続きから

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?