|
La Communauté Webmaster 
| Pages: [1] |
 |
|
|
|
Auteur |
Sujet: CSS alternatif selon URL, comment faire? (Lu 1280 fois) |
|
 |
CSS alternatif selon URL, comment faire?
« sur: le 12-08-2007 a 23:35:36 » |
|
Mudora
Membre récent

Hors-Ligne
Messages: 2

Je suis un lama!
|
Bonjour à tous...
Voilà mon soucis, je développe en ce moment ce site:
http://www.matthieupesche.fr/real/sweetcaprice/
j'aurai aimé faire en sorte que la couleur du fond change selon que l'on soit dans la section chocolat, biscuit ou bonbon.
Je penses qu'il faut pour celà 3 CSS distinct (une par section) mais je ne sais pas faire en sorte que selon l'URL, le site charge tel CSS et non celle par défaut... comment faire? Je ne veux pas laisser le choix au viisteur (donc pas de formulaire) juste charger une autre CSS en fonction de l'URL.
Merci bien par avance:)
Voici mon cote issu de l'index :
<!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" > <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css" media="screen"> @import "csscho.css";.Style1 {color: #FFFFFF} </style>
<title>Sweet Caprice, la confiserie de vos délices </title> </head> <body> <?php <div id="entete"></div>
<div id="menuh">
<a href="mailto:matthieupesche@hotmail.fr"> <img style="border:none; vertical-align:top" onmouseover="this.src='diz/chocolat2.jpg'" onmouseout="this.src='diz/chocolat1.jpg'" src="diz/chocolat1.jpg" alt="envoyez-moi un courriel"/></a>
<a href="mailto:matthieupesche@hotmail.fr"> <img style="border:none; vertical-align:top" onmouseover="this.src='diz/bonbon2.jpg'" onmouseout="this.src='diz/bonbons.gif'" src="diz/bonbons.gif" alt="envoyez-moi un courriel"/></a>
<a href="mailto:matthieupesche@hotmail.fr"> <img style="border:none; vertical-align:top" onmouseover="this.src='diz/biscuit2.gif'" onmouseout="this.src='diz/biscuit1.gif'" src="diz/biscuit1.gif" alt="envoyez-moi un courriel"/></a></div>
<div id="menu"> <? if(isset($_GET['page'])) { if($_GET['page']=="index") { include("menucho.php"); }elseif($_GET['page']=="indexchoco") { include("menucho.php"); }elseif($_GET['page']=="indexbiscuit") { include("menubiscuit.php"); }elseif($_GET['page']=="indexbonbon") { include("menubonbon.php"); }else{ include("menucho.php"); } }else{ include("menucho.php"); } ?></div> <div id="corps">
<? if(isset($_GET['page'])) { if($_GET['page']=="choc") { include("catachoc.php"); }elseif($_GET['page']=="bon") { include("catabon.php"); }elseif($_GET['page']=="bis") { include("catabis.php"); }else{ include("acc.php"); } }else{ include("acc.php"); } ?>
</div>
</body> </html> |
|
et voici ma CSS de base :
body { width: 990px; background-color:#875252; margin: auto; /* Pour centrer notre page */ margin-bottom:20px; font-size: 10px; font-family:Verdana, Arial, Helvetica, sans-serif; }
#entete { width: 990px; height: 78px; background-color:transparent; color:#FFFFFF; background-image: url("diz/head.gif"); background-repeat: no-repeat; }
#menuh { padding-left:120px; margin-bottom:0px; padding-bottom:0px; }
#menu { float: left; /* Le menu flottera à gauche */ width: 120px; /* Très important : donner une taille au menu */ vertical-align:top; background-color:#875252; min-height:540px; }
#corps{ width:870px; vertical-align:top; font-size:15px; font-family:Verdana, Arial, Helvetica, sans-serif; background-color:#FFFFFF; top:auto; padding:none; margin:none; min-height:540px;
}
|
| |
|
|
|
|
| Pages:
[1] |
|
|
|
| |
|
|