28217 sujets

CSS et mise en forme, CSS3

Bonjour,
je débute avec les CSS.
Je suis partie d'un gabarit récupéré sur : Layout gala. Le numéro 7.


Et j'essaye de l'adapter pour avoir ceci :

http://emury.free.fr/css01.png


Cà fonctionne sans problème sur firefox, safari mais ie fait tout foiré...
Je tourne en rond depuis 2 jours, j'ai éplucher le forum, les billets... Mais je n'ai pas trouvé la solutions ! Smiley bawling

Voici le code de la page :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Layout 7</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="HAPedit 3.1">
<style type="text/css">
html,body{
margin:0;
padding:0
}
body{
font: 76% arial,sans-serif;
text-align:center
}
p{
margin:0 10px 10px
}
a
{display:block;color: #981793;
padding:10px
}
div#header{
float:left;
position:absolute;
width:500px;
margin-left: 300px;
height:100px;
background: #EEE;
}
div#container{
text-align:left
}
div#content p{
//line-height:1.4
}
div#footer{
background: #333;color: #FFF
}
div#footer p{margin:0;padding:5px 10px}

div#container{
width:800px;
margin:0 auto;
}
div#wrapper{
float:left;
width:100%;
}
div#content{
width:300px;
margin: 100px 300px
}
div#navigation{
background:#B9CAFF;
float:left;
width:300px;
margin-left:-800px
}
div#extra{
background:#FF8539;
float:left;
width:200px;
margin-left:-200px;
margin-top:100px;
}
div#footer{
clear:left;
width:100%
}
</style>
</head>
<body>
<div id="container">
<div id="header">Header</div>

<div id="wrapper">
<div id="content">
<p><strong>1) Content here.</strong> column long ong column very long fill fill fill long text text column text silly ery make long very fill silly make ake long make text fill very long text column silly silly very column long very column filler fill long make filler long silly very long silly silly silly long filler make column filler make silly long long fill very.</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill fill very filler text fill filler column make fill make text very make make very fill fill long make very filler column very long very filler silly very make filler silly make make column column </p>
<p>fill long make long text very make long fill column make text very silly column filler silly text fill text filler filler filler make make make make text filler fill column filler make silly make text text fill make very filler column very </p>
<p>column text long column make silly long text filler silly very very very long filler fill very fill silly very make make filler text filler text make silly text text long fill fill make text fill long text very silly long long filler filler fill silly long make column make silly long column long make very </p>
</div>
</div>
<div id="navigation">
<p><strong>2) Navigation here.</strong> long long fill filler very fill column column silly filler very filler fill fill filler text fill very silly fill text filler silly silly filler fill very make fill column text column very very column fill fill very silly column silly silly fill fill long filler </p>
</div>
<div id="extra">
<p><strong>3) More stuff here.</strong> column long make silly silly filler silly very very very long column filler fill make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very </p>
</div>
<div id="footer"><p>Here it goes the footer</p></div>
</div>

</body>
</html>


Je pense que c'est le HEADER qui pose problème, mais je ne trouve pas la solution.

Merci pour votre aide
Salut !

J'ai un peu de mal avec la structure de ta page ... voici comment je réaliserais le "découpage" :
<div id="conteneur">
   <div id="navigation">...</div>
   <div id="wrapper">
       <div id="header">Header</div>
       <div id="extra">More stuff ...</div>
       <div id="content">Content here.</div>
   </div>
   <div id="footer">Footer</div>
</div>
et pour le positionnement :
#conteneur {
   width: 770px;
   margin: 0 auto;
}
#navigation {
   float: left;
   width: 200px;
}
#wrapper {
   margin-left: 200px;
}
#extra {
   float: right;
   width: 200px;
}
#content {
   margin-right: 210px;
}
#footer {
   clear: both;
}


Il est aussi possible d'envisager le positionnement absolu au lieu d'utiliser les flottants ...

PS : bienvenue sur Alsa Smiley cligne
Modifié par Sopo (23 Aug 2006 - 12:30)
Merci,
j'ai testé ce que tu m'a donné, çà fonctionne sans probleme jusqu'à ce que je mette une image dans le header où de je lui donne une hauteur en css.
Il ajoute alors un espace entre NAVIGATION et HEADER...uniquement sur IE bien sûr.

Voilà ce que çà donne :
http://emury.free.fr/css02.png

Tu parles de positionnement absolu, qu'est ce que cela change ?
Modifié par manu50 (23 Aug 2006 - 14:28)
Re.

Si tu ne peux pas éviter de faire apparaître cet écart dans IE (c-à-d éviter de doter le header de layout, il faut appliquer une marge gauche de -3px au header ...

Le positionnement absolu, c'est simplement une autre manière de positionner les éléments dans la page. Voir ce qu'en dit l'indispensable FAQ Smiley cligne
Le décalage est probablement dû aux marges ou aux padding de ce qui se trouve à l'intérieur de #contenu et #extra ...

Tu n'aurais pas des titres, au début de ces 2 blocs ? Essaie de modifier leur marge supérieure Smiley cligne

Faut t'accrocher un peu, on ne se dégonfle pas après 1 journée, didju ! Quand tu auras un peu pris le coup de main, tu ne pourras plus t'en passer, tu verras !
Smiley bawling
Muurrfffff !

Rien à faire...à marche pas !
Pas de padding, pas de marge, rien...
Je retente demain, peut-être...

Merci quand même pour les pistes !