Centrer - Fixed Header

Fermé
imp3rium Messages postés 21 Date d'inscription samedi 31 mars 2007 Statut Membre Dernière intervention 10 juin 2012 - 8 oct. 2010 à 16:12
bg62 Messages postés 23598 Date d'inscription samedi 22 octobre 2005 Statut Modérateur Dernière intervention 11 mai 2024 - 8 oct. 2010 à 18:57
Salut à tous,
Voilà j'ai un petit soucis, sinon je ne serais pas ici ... Je suis débutant, donc soyez clément avec moi SVP.

http://imp3rium.free.fr/test/

J'ai commencé un tout nouveau site. Je voudrais que ma div menu soit comme elle est sur la page, mais centrer et sans marge en haut. Au début ma div n'étais pas fixé, je voulais qu'elle reste en haut au premier plan (comme maintenant). Alors j'ai trouvé ce code :

https://limpid.nl/lab/css/fixed/header.htm

Donc je ne sais si c'est le bon à appliquer ou s'il faut autre chose ... Voici ci dessous le code CSS de ma div :

/**** Body ***/ 
body{ 
    background:#aedae9; 
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; 
    font-weight:bold; 
    line-height:normal; 
    color:#FFF; 
    margin:0; 
    padding:<length> 0 0 0; 
    } 
    } 
 div#header{ 
  position:absolute; 
  top:0; 
  left:0; 
  width:100%; 
  height:<length>; 
 } 
 @media screen{ 
  body>div#header{ 
   position: fixed; 
  } 
 } 
 * html body{ 
  overflow:hidden; 
 }  
 * html div#content{ 
  height:100%; 
  overflow:auto; 
 } 
/**** Links ***/ 
a{ text-decoration: none;color:#FFF;} 
a:link{ text-decoration:none;} 
a:visited{ text-decoration:none;} 
/**** Header ***/ 
#header{ 
    background: url(../img/background_header.png) no-repeat; 
    width:1000px; 
    height:108px; 
    margin:auto; 
    } 
.header_navigation{ 
    float:right; 
    width:550px; 
    height:24px; 
    margin:24px 0 0 0; 
    } 
/**** content ***/ 
#content{ 
    width:940px; 
    margin:auto; 
    border-left:1px solid gray; border-bottom:1px solid gray ; border-right:1px solid gray ;         
    padding: 30px; 
    min-height:500px; 
    } 
/**** Footer ***/ 
#footer{ 
    width:1000px; 
    margin:auto; 
    }


Merci d'avance si vous pouvez m'aider

1 réponse

bg62 Messages postés 23598 Date d'inscription samedi 22 octobre 2005 Statut Modérateur Dernière intervention 11 mai 2024 2 364
Modifié par bg62 le 9/10/2010 à 15:34
ben ton affichage est bon ...
#header { 
background:url("../img/background_header.png") no-repeat scroll 0 0 transparent; 
height:108px; 
margin:auto; 
width:1000px;

sauf qu'il ne semble pas faire 1000px ...
et pourquoi ces " .... " dans la css ??? (main.css)
le 'www' est fait aussi pour communiquer, partager et échanger, non ?
merci d'avoir la politesse de répondre à ceux qui essaient de vous aider
-1