Hi all,
I have a page on my site that requires an images to have a dynamic width.
If you look on the page in question [URL=”http://www.postedoverseas.com/top30.php”]http://www.postedoverseas.com/top30.php
you will see that the score for each company. This is made up of 2 images.
Image 1: 5 blank stars
Image 2: a solid orange background behind the stars
At the moment the I have a php script on the page itself with the lines
[code=php] echo ‘<style media=”screen” type=”text/css”>
.starsFull’ . $div . ‘ {
position:absolute;
width:’ . $row_top30[‘score’] . ‘px;
height:20px;
background-image:url(‘images/starsFull.gif’);’;
This works fine in its current configuration, however. As the CSS is on the page itself the page will not validate as XHTML. I am also looking at turning the solid colour to a varying one (say red to green). This means that making the <img width=””> tag dynamic is out of the question as it would simply squeeze the image and not crop it.
Does anyone know of a way that I could either get the CSS accepted by the XHTML validator or get php to crop the image instead of resizing it so that I could create the width tag dynamically.
I hope this all makes sense