aplying css dinamically


hi, thing is, have stuff in php, trying output stuff page, want pretty (or @ least trying).

 

i have made page, , in page there attached stile sheet, have created format, wich includes 'type' (verdana), border , background

 

the php more or less (meta)

 

first try:

 

if (isset($some_var)) {

  echo "<my_style>";

  echo "some stuff";

  echo "</my_style>";

}

 

which, in html should displayed <my_style>some stuff</my_style>

 

when tested thing above there no style attached, tried instead, second try:

 

if (..){

echo "<table class=\"my_style\">";

echo "some stuff";

echo "</table>";

}

 

still no style attached

 

 

what html text should there text 'my stuff' in container stiled 'my_style'?

 

tnx

first try:

 

if (isset($some_var)) {

  echo "<my_style>";

  echo "some stuff";

  echo "</my_style>";

}

 

which, in html should displayed <my_style>some stuff</my_style>

 

when tested thing above there no style attached, tried instead, second try:

 

if (..){

echo "<table class=\"my_style\">";

echo "some stuff";

echo "</table>";

}

 

still no style attached

 

your php fine except it's missing html element. <my_style>some stuff</my_style> isn't going work. need selector hang css on. <p class="my_style">some stuff</p> markup need. so, php code be:

 

     echo "<p class=\"my_style\">";

     echo "some stuff";

     echo "</p>";

 

in second try, css may not appropriate table element. change table element td element , suspect work.

 

if have kind of problem in future, make sure css working html testing without php. once proper markup working css rules, convert php.



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい