Ask a Question related to PHP Development, Design and Development.
-
Savut #1
Re: dynamically loading css-rules!
what is the question, I dont get it, you said it print correctly the styles,
so what's the problem ?
Savut
"Sindre Hiåsen" <paalhi@ifi.uio.no> wrote in message
news:opr8afqo0vomjd1h@news.online.no...> Hi,
>
> I am trying to load the css rules dynamically with php. The rules is
> inside mySQL and looks like this one:
> .20 {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 30px;
> }
> .
> Here is the interesting part of the html code:
> $numCss = count($cssRule);
>
> for($i=0;$i<$numCss;$i++)
> {
> print $cssRule[$i]; //Test to see exactely what is printed out
> }
>
> ?>
>
> <html>
> <head>
> <title>page</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <style type="text/css">
> <!--
> <?php
> for($i=0;$i<$numCss;$i++)
> {
> print $cssRule[$i];
> }
>
> ?>
> -->
> </style>
> </head>
> <body>
>
>
> <table width="100%" height="100" border="0" cellspacing="0"
> cellpadding="0" rules="none" frame="void">
> <tr>
> <td height="80" colspan="8" bgcolor="#0000ff" class="20">Text</td>
> </tr>
> </table>
>
> and this is the actually print out from the test loop
>
> .336 {
> font-family: "Times New Roman", Times, serif;
> font-size: 14px;
> font-weight: bold;
> color: #0000ee;
> text-align: center;
> }
> .337 {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 20px;
> font-weight: bold;
> text-align: center;
> }
> .20 {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 30px;
> }
>
> And there are no errors inside this rules because if I paste this inside
> the style tag's as plane text all works perfectly fine.
>
> Why cant I print out the css rules dynamically this way?
> There is nothing wrong in this though
>
> <?php
> print <<<END
> .20 {
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 30px;
> }
> END;
> ?>
>
> but what's the point? I need to print out the array.
>
> Someone!
>
> regards,
>
> SindreSavut Guest
-
Dynamically loading xml content
I?m creating a menu bar in which the links have to be dynamically created based on the values in the xml, and the number of links(buttons) may even... -
Dynamically loading PNG and GIF files through XML
Hello, I have a project where I need to use XML to dynamically load PNG and GIF files not just JPEGs. I have found forums and information from... -
Loading images dynamically
I have a slideshow that I am working on and the way the slideshow works is that it assigns any number of images i define to an array. problem is,... -
Dynamically Loading UI Components in MX 2004 Pro
Hello, I was wondering how to load the UI components like (RadioButton, Checkboxes, etc) dynamically at runtime. I was fooling around and... -
dynamically loading video
hi flashbrains, anyone know if its possible to dynamically load a video file into a flash movie? i want to have the my SWF reading a text file to... -
Sindre Hiåsen #2
dynamically loading css-rules!
Hi,
I am trying to load the css rules dynamically with php. The rules is
inside mySQL and looks like this one:
..20 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 30px;
}
..
Here is the interesting part of the html code:
$numCss = count($cssRule);
for($i=0;$i<$numCss;$i++)
{
print $cssRule[$i]; //Test to see exactely what is printed out
}
?>
<html>
<head>
<title>page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
<?php
for($i=0;$i<$numCss;$i++)
{
print $cssRule[$i];
}
?>
-->
</style>
</head>
<body>
<table width="100%" height="100" border="0" cellspacing="0"
cellpadding="0" rules="none" frame="void">
<tr>
<td height="80" colspan="8" bgcolor="#0000ff" class="20">Text</td>
</tr>
</table>
and this is the actually print out from the test loop
..336 {
font-family: "Times New Roman", Times, serif;
font-size: 14px;
font-weight: bold;
color: #0000ee;
text-align: center;
}
..337 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-weight: bold;
text-align: center;
}
..20 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 30px;
}
And there are no errors inside this rules because if I paste this inside
the style tag's as plane text all works perfectly fine.
Why cant I print out the css rules dynamically this way?
There is nothing wrong in this though
<?php
print <<<END
..20 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 30px;
}
END;
?>
but what's the point? I need to print out the array.
Someone!
regards,
Sindre
Sindre Hiåsen Guest



Reply With Quote

