isolation property
isolation は CSS のプロパティで、要素が新しい重ね合わせコンテキストを生成する必要があるかどうかを定義します。
対応ブラウザ
| 機能 | デスクトップ | モバイル | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 41 | 79 | 36 | 8 | 41 | 8 | |
基本構文
CSS
.blend-container {
isolation: isolate;
}
.blend-container .overlay {
mix-blend-mode: multiply;
/* The blending effect is confined to the .blend-container */
} ライブデモ
Practical Example: cardinsidelimited
isolation property Practical example: cardinsidelimited demo.
プレビュー全画面表示
実務での使いどころ
-
ブレンドモードの範囲制限
mix-blend-mode の効果がコンテナ外の要素に影響しないよう分離する。
注意点
- isolation: isolate はスタッキングコンテキストを生成するため、z-index の挙動に影響する。
アクセシビリティ
- isolation は視覚的な表示制御のみで、アクセシビリティに直接影響はないが、z-index の変化で操作順序に影響がないか確認する。