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 ? ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |