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: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.telegram from ua


Telegram CodeBase | Frontend
FROM USA