Браузер |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||||||||||||
Версия |
6.0 |
7.0 |
8.0 |
9.0 |
2.0 |
3.0 |
4.0 |
5.0 |
9.2 |
9.6 |
10 |
2.0 |
3.1 |
4.0 |
5.0 |
2.0 |
3.0 |
3.6 |
4.0 |
|
Поддержка |
CSS | CSS2+ |
Значение по умолчанию | auto |
Наследуется | Нет |
Применяется | Ко всем элементам |
Ссылка на спецификацию | открыть в новой вкладке |
left: значение | проценты | auto | inherit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>left</title>
<style type="text/css">
.layer1 {
position: absolute; /*Абсолютное позиционирование*/
left: 20px; /*Положение от левого края*/
background: #fc3; /*Цвет фона*/
margin: 7px; /*Отступы вокруг элемента*/
}
.layer2 {
position: relative; /*Относительное позиционирование*/
left: -12px; /*Положение от левого края*/
top: 13px; /*Положение от верхнего края*/
border: 1px solid black; /*Параметры рамки*/
padding: 5px; /*Поля вокруг текста*/
margin: 7px; /*Отступы вокруг элемента*/
}
</style>
</head>
<body>
<div id="layer1">
<div id="layer2">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem
nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat
volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</div>
</div>
</body>
</html>