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?

【CSS】overflow: clipについて

0
Posted at

概要

  • はみ出したコンテンツを視覚的に隠す
  • プログラムによるスクロールを完全に無効化
  • 要素はスクロールコンテナではなくなる

スクロール無効化の挙動

// overflow: clipの場合
const clipElement = document.getElementById("clip");
clipElement.scrollTop = clipElement.scrollHeight; // 動作しない

軸ごとの独立制御

overflow: clipでは軸間の依存関係がありません。

/* 正常動作:x軸は表示、y軸はクリップ */
.element {
  overflow-x: visible;
  overflow-y: clip;
}

参考

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?