par
piervi » 14 déc. 2012, 18:36
Bonjour à tous.
J'ai un problème de rendu css et je n'arrive pas à m'en dépatouiller!
Ma <div id="global"> (ou ma bg-image?) est centrée par rapport à la page web aussi bien verticalement qu'horizontalement. au lieu d'etre en haut de la page comme je le souhaiterais...Qu'est-ce qui est à corrigé dans mon code svp?
voici le html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Index.php</title>
<link href="css/TPierre_css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="global">
<div id="contenu">
</div>
</div>
</body>
</html>
et css
body
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
background-color:#dddddd;
text-align: center;
visibility: visible;
z-index: 1;
width: 100%;
height:100%;
}
#global
{
z-index:2;
width:1100px;
height:1000px;
background-image:url(../src/logo-detoure-final1100px.gif);
background-repeat:no-repeat;
background-position:top;
margin:auto;
}
#global #contenu
{
border:2px solid #000000;
z-index:3;
background-color:#ffffff;
margin-top:150px;
margin-left:auto;
margin-right:auto;
width:750px;
height:700px;
}
Merci d'avance à cette communauté qui me sort toujours de la galère rapidement... =D>
Piervi
Bonjour à tous.
J'ai un problème de rendu css et je n'arrive pas à m'en dépatouiller!
Ma <div id="global"> (ou ma bg-image?) est centrée par rapport à la page web aussi bien verticalement qu'horizontalement. au lieu d'etre en haut de la page comme je le souhaiterais...Qu'est-ce qui est à corrigé dans mon code svp?
voici le html:
[html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Index.php</title>
<link href="css/TPierre_css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="global">
<div id="contenu">
</div>
</div>
</body>
</html>[/html]
et css
[css]body
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: normal;
background-color:#dddddd;
text-align: center;
visibility: visible;
z-index: 1;
width: 100%;
height:100%;
}
#global
{
z-index:2;
width:1100px;
height:1000px;
background-image:url(../src/logo-detoure-final1100px.gif);
background-repeat:no-repeat;
background-position:top;
margin:auto;
}
#global #contenu
{
border:2px solid #000000;
z-index:3;
background-color:#ffffff;
margin-top:150px;
margin-left:auto;
margin-right:auto;
width:750px;
height:700px;
}[/css]
Merci d'avance à cette communauté qui me sort toujours de la galère rapidement... =D>
Piervi