Bonjour,
Soit le code suivant:
Je souhaiterais réussir à supprimer totalement les hacks de mon code css...
Ceux-ci étant bien souvent dûs aux tailles de boîtes différentes sous IE, y'a-t-il une manière de procéder particulière pour les éviter? Et comment dois-je modifier mon code?
Merci.
Modifié par koala64 (06 Jun 2005 - 10:24)

Soit le code suivant:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Mise en page</title>
<meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-15" />
<style type="text/css">
<!--
* { margin: 0; padding: 0; }
body { background: #000; }
p { margin: 10px; color: #DB8; }
#title, .menu, .box, #bottom { background: #555; border: 2px outset #DB8; }
#navig, #main, .box, #bottom { float: left; }
#title, .subtitle, #bottom { text-align: center; color: #DFA; }
#global { position: relative; left: 50%; margin-top: 5px; margin-left: -400px; width: 800px; }
#title { width: 796px; height: 76px; line-height: 76px; }
#bottom { margin: 5px 0 0 5px; width: 591px; height: 66px; line-height: 66px; }
.menu { margin: 5px 0; width: 196px; height: 296px; }
.box { margin: 5px 0 0 5px; width: 291px; height: 258px; }
.subtitle { background: #888; height: 29px; border-bottom: 1px solid #000; line-height: 29px; }
*html #main { margin-left: -5px; } /* F.ck IE */
//-->
</style></head> <body><div id="global">
<div id="title"><h1>Titre</h1>
</div>
<div id="navig">
<div class="menu"><div class="subtitle"><h2>Menu 1</h2></div>
<p>blabla...</p>
</div>
<div class="menu"><div class="subtitle"><h2>Menu 2</h2></div>
<p>blabla...</p>
</div>
</div>
<div id="main">
<div class="box"><div class="subtitle"><h2>Box 1</h2></div>
<p>blabla...</p>
</div>
<div class="box"><div class="subtitle"><h2>Box 2</h2></div>
<p>blabla...</p>
</div>
<div class="box"><div class="subtitle"><h2>Box 3</h2></div>
<p>blabla...</p>
</div>
<div class="box"><div class="subtitle"><h2>Box 4</h2></div>
<p>blabla...</p>
</div>
<div id="bottom"><h2>Pied de page</h2></div>
</div>
</div></body> </html>
Je souhaiterais réussir à supprimer totalement les hacks de mon code css...
Ceux-ci étant bien souvent dûs aux tailles de boîtes différentes sous IE, y'a-t-il une manière de procéder particulière pour les éviter? Et comment dois-je modifier mon code?
Merci.

Modifié par koala64 (06 Jun 2005 - 10:24)