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

container-type: inline-sizeを親に指定したら子や孫要素でposition: fixedが使えない

Posted at

概要

タイトルそのままです。

.parent {
  container-type: inline-size
}
.child {
  position: fixed;
}
<div class="parent">
  <div class="child">子要素</div>
  <div>
    <div class="child">孫要素</div>
  </div>
</div>

階層は関係なく、子要素も孫要素もfixedの配置になりません。
absoluteを指定した時と同じように配置されるようです。

原因の特定に気づくのに時間がかかったので共有です。
仕様っぽいですね。

参考

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