Bonjour,
j'ai une page sommes toutes assez simple :
Un div conteneur remplissant toutes la page. (contents)
Un div header, pour le haut
Un div main, pour le centre
Un div footer, pour le pied de page.
ça me donne en html :
<html>
<head></head>
<body>
<div id="contents>
<div id="header"></div>
<div id="main"></div>
<div id="footer"></div>
</div>
et le Css correspondant
Code :
- html, body, #contents
- {
- min-height: 100%;
- width: 100%;
- height: 100%;
- }
- /*
- * The "height" above is a hack for IE5+/Win. Below we adjust
- * it using the child selector to hide from IE5+/Win
- */
- html>body, html>body #contents
- {
- height: auto;
- }
- /*
- * Without this, Moz1.0 adds a vertical scrollbar
- */
- body
- {
- margin: 0;
- font-family: verdana;
- }
- #contents
- {
- position: absolute;
- top: 0;
- left: 0;
- }
- #header
- {
- position: absolute;
- top: 0;
- left: 0;
- background-color: #aaeeaa;
- width: 100%;
- text-align: center;
- }
- #footer
- {
- position: absolute;
- bottom: 0;
- left : 0;
- background-color: #ccbbaa;
- width: 100%;
- text-align: center;
- font-family:verdana;
- font-size:10px;
- color:navy;
- }
- #main
- {
- margin-top: 10em;
- margin-bottom: 5em;
- height: auto;
- padding: .5em;
- background-color: #aabbcc;
- }
|
Je voudrais que mon header, main et footer, s'adpate au contenu.
La comme c'est fait le main est tjs au même endroit.
merci