|
|
|
|
Bonjour,
J'ai un créé un css dynamique via php en l'appellant via :
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="monsite.com/fichiers/site/design/principal.php" />
<?php
header("Content-type:text/css; charset=iso-8859-1");
echo('
body {
background:url(monsite.com/fond.png) no-repeat center top;
background-color:#525252;
color:#FFFFFF;
font-family:tahoma; font-size:10pt;
margin:0px;
text-align:center;
}
');
?>
background-color:' . $couleur . '
Configuration: Windows XP Safari 525.26.13
Voilà :
<?php
header("Content-type:text/css; charset=iso-8859-1");
echo('
body {
background:url(http://127.0.0.1/Atelier%20de%20la%20Foulque/fichiers/img/fond/fond.png) no-repeat center top;
background-color:#525252;
color:#FFFFFF;
font-family:tahoma; font-size:10pt;
margin:0px;
text-align:center;
}
a {
color:#FFFFFF;
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
img {
border:0px;
}
.menu {
margin: 0;
padding: 0;
list-style: none;
text-align:justify;
}
.menu a {
display: block;
padding: 4px 10px;
text-decoration: none;
}
.menu .sousmenu {
font-size: 10pt;
margin: 0;
padding: 0;
list-style: none;
}
.menu ul.sousmenu a {
background: none;
color:#525252;
padding: 3px 20px;
}
');
?> |
Oulah. J'étais sur une fausse piste, je viens de comprendre ton problème :)
|
Oui mais tu n'as guère d'autres moyens de faire passer des paramètres de la page vers le css.
|
Moi ça ne me gène pas de les stocker dans mysql mais cela ne marche pas :
<?php
header("Content-type:text/css; charset=iso-8859-1");
$query = mysql_query("SELECT * FROM css");
if($css = mysql_fetch_assoc($query))
{
echo('
body {
background:url(monsite.com/fichiers/img/fond/fond.png) no-repeat center top;
background-color:#525252;
color:#' . $css['couleur'] . ';
font-family:tahoma; font-size:10pt;
margin:0px;
text-align:center;
}
a {
color:#FFFFFF;
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
img {
border:0px;
}
.menu {
margin: 0;
padding: 0;
list-style: none;
text-align:justify;
}
.menu a {
display: block;
padding: 4px 10px;
text-decoration: none;
}
.menu .sousmenu {
font-size: 10pt;
margin: 0;
padding: 0;
list-style: none;
}
.menu ul.sousmenu a {
background: none;
color:#525252;
padding: 3px 20px;
}
');
}
?> |