mi conviene impostare il colore di sfondo nel tag h...
Esatto.
Quindi la tua pagina potrebbe diventare:
codice:
<?xml version="1.0"?>
<!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="it" lang="it">
<head>
<title></title>
<style type="text/css">
@import url("stile.css");
</style>
<!--[if lte IE 6]>
<link rel="stylesheet" href="stile-ie.css" type="text/css" media="screen" />
<![endif]-->
</head>
<body>
<div id="box">
<div id="contenitore">
<h1 class="intestazione">Intestazione</h1>
Altro testo testo testo testo</p>
</div>
</div>
</body>
</html>
Il tuo CSS:
codice:
#box {
width: 600px;
position: relative;
border: 2px solid #000;
}
#contenitore p, #contenitore h1{
padding: 1%
}
.intestazione{
font-family:Verdana, Arial, Helvetica, sans-serif;
color: #FFF;
display: block;
width: 98%;
background: #000;
margin: 0
}
Il CSS per IE:
codice:
.intestazione{
width: 100%;
}