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?

ヘッダーを固定しよう

Posted at

ヘッダーを固定する

Webアプリでヘッダーを固定しようと思います。

IEのときは苦戦しましたが、Edgeでは
position: sticky;
が使えます。

いつも使う頃に忘れているので、サンプルコード纏めておきます。

サンプルその1

See the Pen Untitled by masayasu_t (@cjlsrdxi-the-builder) on CodePen.

タイトルだけだとつまらないので、サブタイトルも固定しています。
htmlでは下に書かれた要素が前方に来るため、z-indexを指定しないとサブタイトルがタイトルの上に来ます。

サンプルその2

See the Pen Untitled by masayasu_t (@cjlsrdxi-the-builder) on CodePen.

テーブルで縦横のヘッダー、フッターを固定しています。
罫線がきれいになるように線を描画する側のセルを意識しています。

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?