Bonjour,
Je commence un nouveau design et je voudrai mettre un padding de 20px à mon div id="homepage" afin de créer une marge de 20 pixels tout autour des blocs rouges.
Voir ici.
J'ai bien appliqué padding:20px; mais j'ai un déformation de ma div id="homepage". L'exemple est sans padding:20px sur div id="homepage".
Quelle est la bonne méthode pour appliquer cette marge intérieure ?
Modifié par karnabal (24 Aug 2006 - 10:06)
Je commence un nouveau design et je voudrai mettre un padding de 20px à mon div id="homepage" afin de créer une marge de 20 pixels tout autour des blocs rouges.
Voir ici.
J'ai bien appliqué padding:20px; mais j'ai un déformation de ma div id="homepage". L'exemple est sans padding:20px sur div id="homepage".
Quelle est la bonne méthode pour appliquer cette marge intérieure ?
* { margin:0; padding:0;}
html { height:100%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; overflow:hidden;
}
body {
margin:0;
text-align:center;
height:100%;
}
#conteneur { margin-top:55px; width:960px; margin-left:auto; margin-right:auto; text-align:left; background-color:violet;
}
#header { position:relative; width:960px; height:205px; background-color:#B5B5B5;
}
#navi { position:relative; width:960px; height:137px; background-color:blue;
}
#navi ul li { list-style-type:none; display:inline; background-color:#FF9FAA;
}
#homepage { width:960px; height:100%; background-color:yellow; padding-top:20px;
}
div.b-unique { width:920px; height:260px; background-color:#D41F55;
}
div.b-tiers { width:168px; height:260px; margin-top:10px; margin-right:10px; background-color:#D41F55; display:block; float:left;
}
#footer { width:100%; height:50px; padding-top:30px; clear:both; background-color:#7FBF00;
}
<!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>
<title>Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" type="image/png" href="images/favicon.png" />
<meta http-equiv="Content-Language" content="fr"/>
<meta name="keywords" content="blabla" />
<meta name="date" content="2006-06-20" />
<meta name="author" content="Itsme" />
<!-- saved from url=(0014)about:internet -->
<script src="js.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
<style type="text/css">
<!--
@import url(styles.css);
-->
</style>
</head>
<body>
<div id="conteneur">
<div id="header"> </div>
<div id="navi">
<ul>
<li> </li>
</ul>
</div>
<div id="homepage">
<div class="b-unique"><a href="http://w3qc.org/validateur/index.php?uri=referer">Validation</a></div>
<div class="b-tiers"> </div>
<div class="b-tiers"> </div>
<div class="b-tiers"> </div>
<p> </p>
</div>
<div id="footer"> </div>
</div>
</body>
</html>
Modifié par karnabal (24 Aug 2006 - 10:06)