dynamically loading css-rules!

This is a discussion on dynamically loading css-rules! within the alt.comp.lang.php forums, part of the PHP Programming Forums category; what is the question, I dont get it, you said it print correctly the styles, so what's the problem ? ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-21-2004
Savut
 
Posts: n/a
Default 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,
>
> Sindre


Reply With Quote
  #2 (permalink)  
Old 05-20-2004
Sindre Hiåsen
 
Posts: n/a
Default 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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:47 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0