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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -