FRONTEND_1 Telegram 3972
🧩 Трюк с z-index, о котором часто забывают

Если у вас не работает z-index — причина может быть не в его значении, а в контексте наложения (stacking context).

❗️Вот что его создаёт (неочевидное):

* position: fixed | absolute | relative + z-index ≠ auto
* transform, filter, perspective, opacity < 1
* will-change, mix-blend-mode, contain: layout и другие

📦 Пример:


.parent {
transform: translateZ(0); /* создаёт stacking context */
z-index: 10;
}

.child {
position: absolute;
z-index: 999; /* но не выйдет за пределы .parent */
}


🧠 Вывод: z-index работает только внутри текущего контекста наложения. Чтобы перекрыть что-то выше — нужно изменить контекст.

📚 Подробнее: https://developer.mozilla.org/ru/docs/Web/CSS/CSS_positioned_layout/Stacking_context

👉 @frontend_1
👍12



tgoop.com/frontend_1/3972
Create:
Last Update:

🧩 Трюк с z-index, о котором часто забывают

Если у вас не работает z-index — причина может быть не в его значении, а в контексте наложения (stacking context).

❗️Вот что его создаёт (неочевидное):

* position: fixed | absolute | relative + z-index ≠ auto
* transform, filter, perspective, opacity < 1
* will-change, mix-blend-mode, contain: layout и другие

📦 Пример:


.parent {
transform: translateZ(0); /* создаёт stacking context */
z-index: 10;
}

.child {
position: absolute;
z-index: 999; /* но не выйдет за пределы .parent */
}


🧠 Вывод: z-index работает только внутри текущего контекста наложения. Чтобы перекрыть что-то выше — нужно изменить контекст.

📚 Подробнее: https://developer.mozilla.org/ru/docs/Web/CSS/CSS_positioned_layout/Stacking_context

👉 @frontend_1

BY Frontend разработчик


Share with your friend now:
tgoop.com/frontend_1/3972

View MORE
Open in Telegram


Telegram News

Date: |

Among the requests, the Brazilian electoral Court wanted to know if they could obtain data on the origins of malicious content posted on the platform. According to the TSE, this would enable the authorities to track false content and identify the user responsible for publishing it in the first place. The best encrypted messaging apps Matt Hussey, editorial director of NEAR Protocol (and former editor-in-chief of Decrypt) responded to the news of the Telegram group with “#meIRL.” Polls Telegram Android app: Open the chats list, click the menu icon and select “New Channel.”
from us


Telegram Frontend разработчик
FROM American