vue sur http://www.eveo.org
site de téléchargement pour la modification facile:
http://www.eveo.org/backup/eveo.rar
http://www.eveo.org/backup/eveo.zipCentrer un site Web horizontalement et verticalement
Comme vous pouvez le voir en ce moment, il est centré horizontalement et verticalement en une méthode de table simple:
<table cellpadding="0" cellspacing="0">
<tr>
<td align="left">
*put anything in here and it will be aligned horizontally and vertically
</td>
</tr>
</table>
accompanying CSS:
table
{
height: 100%;
width: 100%;
vertical-align: middle;
}
Cependant, dans mon document, je ne l'ai pas mis un doctype, je ne dispose que:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Si j'ajoute un type de document standard tel que:
<!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" lang="en" xml:lang="en">
ma méthode de table n'est plus valide et ne fonctionne pas. J'ai donc besoin d'une nouvelle façon de centrer ma page Web verticalement et horizontalement, quelle que soit la taille de la fenêtre du navigateur.
voir http://stackoverflow.com/questions/396145/whats-the-best-way-of-centering-a-div-vertically -avec-css? – Mat