par
Cyrano » 28 oct. 2005, 13:00
Pour un centrage horizontal, utilise un style CSS au lieu d'un tableau HTML. Malheureusement, pour le centrage vertical, IE n'interprête pas coerrectement les standards et on le peut pas utiiser ce système:
<!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=iso-8859-1">
<title>Centrage horizontal d'un bloc</title>
<style type="text/css">
#fond_photo {
position: relative;
left: 50%;
width: 400px;
margin-left: -200px;
height: 400px;
color: #000;
background-color: #99f;
border: 1px solid #f00;
}
</style>
</head>
<body>
<div id="fond_photo"><p>Bla bla bla</p></div>
</body>
</html>
Pour un centrage horizontal, utilise un style CSS au lieu d'un tableau HTML. Malheureusement, pour le centrage vertical, IE n'interprête pas coerrectement les standards et on le peut pas utiiser ce système:
[php]<!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=iso-8859-1">
<title>Centrage horizontal d'un bloc</title>
<style type="text/css">
#fond_photo {
position: relative;
left: 50%;
width: 400px;
margin-left: -200px;
height: 400px;
color: #000;
background-color: #99f;
border: 1px solid #f00;
}
</style>
</head>
<body>
<div id="fond_photo"><p>Bla bla bla</p></div>
</body>
</html>[/php]