Z-index
Русский перевод: Z-index
Свойство Z-index определяет уровень стека отображения элемента на странице относительно других элементов. Его значением является число. Чем больше z-index элемента, тем ближе он к пользователю.
Пример кода:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.logo {
position:absolute;
font-family:Century;
font-size:2em;
font-weight:bold;
z-index:20;
}
#logo1 { left:50px; top:50px; color:#00f; }
#logo2 { left:52px; top:52px; color:#f00; z-index:10; }
.box { position:absolute; height:100px; width:100px; border:15px solid #000; }
#box1 { left:150px; top:150px; border-color:#f00; z-index:40; }
#box2 { left:185px; top:185px; border-color:#00f; z-index:30; }
#box3 { left:185px; top:150px; border-color:#060; z-index:20; }
#box4 { left:150px; top:185px; border-color:#f60; z-index:10; }
</style>
<title>CSS Z-Index</title>
</head>
<body>
<h1>CSS Z-Index</h1>
<div id="logo1" class="logo">Webucator</div>
<div id="logo2" class="logo">Webucator</div>
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
<div id="box3" class="box"></div>
<div id="box4" class="box"></div>
</body>
</html>
Обратите внимание, как некоторые элементы div расположены поверх других. Если изменить z-index этих элементов, порядок их наложения изменится.
Display
Свойство display применяется для определения, должен ли элемент отображаться на странице или нет. Наиболее популярные значения: block, inline, none.
Пример кода:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS Link Buttons</title>
<style type="text/css">
a {
display:block;
padding: 6px 4px;
margin: 4px;
border-right: 2px solid #999999;
border-bottom: 2px solid #999999;
border-top-width: 0px;
border-left-width: 0px;
background-color: #eaf1dd;
color:#060;
text-decoration:none;
font-family:Verdana, Geneva, sans-serif;
font-size:1.5em;
}
</style>
</head>
<body>
<h1>Button Links</h1>
<div>
<a href="http://www.washingtonpost.com">WashingtonPost.com</a>
<a href="http://www.webucator.com">Webucator</a>
<a href="http://www.google.com">Google</a>
</div>
</body>
</html>
Visibility (Видимость)
Свойство visibility используется для управления видимостью элемента. Возможные значения: visible, hidden. Основное отличие между visibility:hidden и display:none в том, что скрытый элемент всё ещё занимает место на странице.