je suis je suis nouveau en CSS .. j'ai converti mon fichier psd en html/css .. maintenant je veux déplacer ma page web au centre de la fenêtre .. j'ai essayé du code et aligner code seul texte l'image d'arrière-plan "back.gif" reste à gauche .. voici mon code html et CSS »comment centrer une page Web en CSS
**HTML**
<body>
<div id="main">
<div id="header">
<div id="logo">
<img src="logo.gif" />
</div>
</div>
<div id="menu">
<img src="images/menu_07.gif" />
<div id="m">
<ul>
<li> <a href="index.php">Home</a></li>
<li> <a href="pages.php">Pages</a></li>
<li> <a href="donor.php">Donor</a></li>
<li><a href="seeker.php">Seeker</a></li>
<li><a href="hospitals.php">Hospitals</a></li>
<li><a href="lifesaving.php">Life Saving Contacts</a></li>
<li><a href="contactus.php">Feedback</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="center" align="center">
<h3>WELCOME TO ADMIN AREA</h3>
<p id="ajk">AJKBLOODBANK.COM</p>
<?php
echo "welcome!".$_SESSION['username'];
echo "<br>";
echo "<a href=logout.php>Logout</a> ";
?>
</div>
</div>
<div id="footer">
</div>
</div>
</body>
**CSS**
body
{
background:url(../back.gif) repeat-y;
padding-left:105px;
height:900px;
text-align: center;
margin:auto;
min-width: 760px;
}
div#main
{
width: 720px;
margin: 0 auto;
text-align: left;
}
#header
{
width:787px;
margin-top:10px;
}
#menu
{
width:787px;
float:left;
margin-top:20px;
}
#content
{
background-color:#FFF;
border:groove;
width:790px;
float:left;
padding-top:30px;
margin-top:30px;
}
#footer
{
float:left;
height:52px;
width:790px;
}
S'il vous plaît me dire où je l'ai fait erreur ..
the diameseion of background image "backgif" = 995x1000
je mets ce code ,, – maham
'body { \t arrière-plan: url (../ back.gif) haut du centre de répétition; \t} #main { \t arrière-plan: url (../ back.gif) repeat-y; \t largeur: 995px; \t marge: 0 auto; \t} 'cela a déplacé l'image d'arrière-plan au centre .. mais la div principale est à gauche .. @Madbreaks – maham
Prenez une grande respiration. Pourquoi mettre l'image d'arrière-plan dans les deux éléments? Mettez-le dans l'élément du corps. Si '# main' est toujours à gauche, essayez d'ajouter' height: 100%; largeur: 100%; 'à votre corps' css. – Madbreaks