Создать форум бесплатно: ixbb.ru :: Календарь на Апрель 2024 года: calendar2008.ru/2024/aprel/

  Reply to this topicStart new topicStart Poll

Непонятки с позиционированием блоков

, z-index
lutsk
Отправлено: Aug 30 2013, 08:21 PM
Quote Post


  Солдат
*

Группа: Members
Сообщений: 7
Пользователь №: 2883
Регистрация:
6-October 09



Всем здрасте!

Код:
CODE

<div class="parent">
   <div class="child_1"></div>
   <div class="child_2"></div>
</div>
<div class="parent">
   
</div>


CSS:
CODE

.parent {
   background-color: #F9F;
   position: relative;
   height: 100px;
   width: 200px;
   z-index: 1;
}
.parent .child_1,
.parent .child_2 {
   background-color: #F00;
   position: absolute;
   height: 50px;
   width: 200px;
   left: 0px;
   z-index: 2;
}
.parent .child_1 {
   top: -50px;
}
.parent .child_2 {
   bottom: -50px;
}


child_2 первого блока уходит под второй parent, хотя по z-index не должен. Почему?
PMEmail Poster
Top

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0316 ]   [ 10 queries used ]   [ GZIP выключен ]