php - Can the width in css be selected dynamically with a variable -
the code :
<div class="bar"> <div class="percentage" style="width:16%; height: 59px;">this 66% wide div</div> </div>
as can see width 16 here....i need way changed based on variable like. have php query returns vale. , width must vale. how can that?
you can javascript. example jquery:
$('.percentage').css({'width': x%, 'height': xpx});
or can php:
<div class="percentage" style="width: <?php echo $width; ?>%; height: <?php echo $height; ?>px; ">this 66% wide div</div>
Comments
Post a Comment