Telegram Group & Telegram Channel
⚙️ Что такое свойство z-index в CSS и зачем оно используется?

z-index управляет порядком наложения элементов на странице. Чем больше значение — тем "выше" элемент расположен относительно других.

Работает только с элементами, у которых задано position (relative, absolute, fixed или sticky).

➡️ Пример:

<div class="box box1">Позади</div>
<div class="box box2">Поверх</div>

<style>
.box {
position: absolute;
width: 200px;
height: 100px;
color: white;
padding: 10px;
}

.box1 {
background: #888;
top: 50px;
left: 50px;
z-index: 1;
}

.box2 {
background: #e74c3c;
top: 80px;
left: 80px;
z-index: 2;
}
</style>


🗣 В этом примере .box2 перекрывает .box1, потому что у неё z-index: 2.

CodeBase | Frontend | #CSS
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/codebase_frontend/733
Create:
Last Update:

⚙️ Что такое свойство z-index в CSS и зачем оно используется?

z-index управляет порядком наложения элементов на странице. Чем больше значение — тем "выше" элемент расположен относительно других.

Работает только с элементами, у которых задано position (relative, absolute, fixed или sticky).

➡️ Пример:

<div class="box box1">Позади</div>
<div class="box box2">Поверх</div>

<style>
.box {
position: absolute;
width: 200px;
height: 100px;
color: white;
padding: 10px;
}

.box1 {
background: #888;
top: 50px;
left: 50px;
z-index: 1;
}

.box2 {
background: #e74c3c;
top: 80px;
left: 80px;
z-index: 2;
}
</style>


🗣 В этом примере .box2 перекрывает .box1, потому что у неё z-index: 2.

CodeBase | Frontend | #CSS

BY CodeBase | Frontend


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/codebase_frontend/733

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

telegram from it


Telegram CodeBase | Frontend
FROM USA