|
|
|
|
Bonjour,
J'ai mis un pied de page qui soit visible sur chaque page html de mon site par contre je n'arrive à centrer mon texte au centre. Il démarre du milieu de la page et donc se retrouve sur la droite. Voic mon CSS :
* { margin:0;padding:0;}
html {
height:100%;
width:100%;
}
html img.imghtml, html div.imghtml{
width:100%;height:100%;
top:0;
left:0;
position:absolute;
}
html, html * {
position:relative;
z-index:0;
}
body { top:0;
left:0;
position:absolute;
z-index:1;
width:100%;
height:100%;
overflow:hidden;
color:#000;
text-align:center;
}
#corps {
width:100%;
height:100%;
border:3px solid #000;
margin:auto;
border-top:0;
border-bottom:0;
overflow:auto;
}
#footer {
position: absolute;
bottom: 0;
padding: 10px;
width: center;
color:#fff;
}
Et partie HTML pour le pied de page :
<html> <head> <link href="test.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="footer"> <font size=1>| © 2009 tous droits réservés | Plan d'accès | Contacter | </font> </body> </html>
Pouvez-vous m'aider à trouver l'erreur?
Merci
Configuration: Windows XP Internet Explorer 7.0
Ok, mais c'est bizarre quand meme :
|
On ne peut pas centrer automatiquement une div en absolute donc on crée une div dans le div.
<div id="footer"> <div id="foot_interne"> <font size=1>| © 2009 tous droits réservés | Plan d'accès | Contacter |</font> </div> </div> Le CSS: #footer {
position: absolute;
bottom: 0;
padding: 10px;
width: 100%;
color:#fff;
}
#foot_interne {
position: relative;
margin-left: auto;
margin-right: auto;
width: 150px; // ici tu met la taille dont tu as besoin, pas plus
}
ça devrai marcher. Deux intellectuels assis vont moins loin qu'une brute qui marche. !!! Vous avez obtenu une réponse ... Pensez à marquer vos sujets comme résolus !!! |
Voici le code HMTL et CSS pour mettre un pied de page fixe sur chaque page et centré :
<html> <head> <link href="test.css" rel="stylesheet" type="text/css" /> </head> <div id="footer"> <div id="foot_interne"> <font size=1>VOTRE TEXTE</font> </div> </div> </html> Fichier test.css : #footer {
position: absolute;
bottom: 0;
padding: 10px;
width: 100%;
color:#fff;
}
#foot_interne {
width: 100%;
margin-left: auto;
margin-right: auto;
text-align:center;
} |

