<html>
<style>
<style type="text/css" media=screen>
.center {
text-align: center;
}
.hi {
background: #FFFF00;
}
</style>
<body>
<p class="hi"><code><p class="hi"></code> - questo paragrafo è evidenziato in giallo.</p>
<p class="center"><code><p class="center"></code> - perché questo paragrafo non è centrato?</p>
</body>
</html>Perché il paragrafo con
class="center" non è centrato?
E indovina che succede se inverto l'ordine delle istruzioni CSS:
.center {
text-align: center;
}
.hi {
background: #FFFF00;
}