php - Html attribute with echo -


i have next html element:

<div class="bar bar-success" style="width: 20%;"><? echo $pass; ?></div> 

now, want width element changed according echo element .

i try next:

 <div class="bar bar-success" style=<? echo $pass; ?>/<? echo $fail; ?>%;><? echo $pass; ?></div> 

but doesn't work. how can it?

this might help....

<div class="bar bar-success" style="width: <?php echo round($pass/$fail); ?>%"><?php echo $pass; ?></div> 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -