DOCTYPE html PUBLIC W3C DTD XHTML Transitional EN http www w3 org TR x

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
<title>XHTML divs</title>
<style type="text/css">
html {
height:100%;
}
body {
margin:0;
padding:0;
height:100%;
}
#lb_table {
display: table;
width:100%;
height: 100%;
position: relative;
//top: 50%;
//height: auto;
}
#lb_table_cell {
display: table-cell;
height: 100%;
vertical-align: middle;
position: relative;
text-align: center;
//height: auto;
//top: -50%;
}
</style>
</head>
<body>
<div id="lb_table"><div id="lb_table_cell">
Центр!
</div></div>
</body>
</html>