I have the following style (bottom), which contains some php which provides
the left and top values. This style is incorporated into the html at the
bottom and controls the position of $heading1. Problem is I wish to use the
same style for heading2, heading 3 etc. However they all will have different
positions. I could create a separate style for each. but Im sure there must
be a way of using the same style.
I had the idea of putting the style in a php function such as
<?php function myfunction($posx, $posy){ ?>
.mystyle{
position:absolute; left:<?php echo $posx;?>px; top:<?php echo $posy;?>px;
}
<?php } ?>
but this didnt work. Help greatly appreciated. my current code is below
Ian
******************************
<style>
<!--
.txtposition{
position:absolute; left:<?php echo $xh1;?>px; top:<?php echo $yh1;?>px;
}
-->
</style>
<span class="txtposition">span class="drag"><?php echo $heading1
?></span></span>
******************************************************
Andy Dingley - 31 Jul 2006 11:30 GMT
> I have the following style (bottom), which contains some php which provides
> the left and top values.
Redesign to not need position:absolute. It's a whole world of pain to
deal with, it kills off fluid-design, and if you're having to generate
the position numbers dynamically, it's a strong indication that the
design is flawed.
Anything else is a PHP problem, OT in this ng. Try catching the HTML
output and validating / debugging that. You either have a CSS problem
here or a PHP problem in generating exactly what you want - unlikely to
be both causing trouble, so just chop the problem in half and fix the
half that needs it.