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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -