Jump to content

A progress bar looks goos in FF but not IE


TONYTOC

Recommended Posts

Hopefully you guys can help me with this one. I have a stats module running on my site which has progress bars generated on the ranks and some awards given in the game. The code below works great on FF and chrome but IE is not handling the html correctly. The bars are way to fat on ie.

 

function generateProgress($max,$score){

// Last Rank reached?

if ($max == '0') $max = $score;

if ($score > $max) $score = $max;

// Generate the width

$width = number_format(floor(($score/$max)*100), 0);

$width = ($width < 1) ? 0 : $width;

// Generate the bar

return '<div class="progressbar"><div class="bar" style="width: '.$width.'%"></div></div>';

}

 

 

site: http://www.toctheothercrew.com/modules.php?name=BC2_Stat_Tracker

 

The author of the code is a pretty busy young man so id like to solve this one with some outside help.

Not a PHP problem.

 

Try changing your css:

 

From this:

<style type="text/css">
.progressbar {
border: #333333 1px solid;
height: 2px;
margin: 0 2px;
padding: 1px;
width: 72px;
}
.bar {
background-color: #ff7700;
height: 2px;
float: left;
}
</style>

 

to this:

 

<style type="text/css">
.progressbar {
border: #333333 1px solid;
height: 2px;
margin: 0 2px;
font-size: 0px;
padding: 1px;
width: 72px;
}
.bar {
background-color: #ff7700;
height: 2px;
line-height: 2px;
font-size: 0px;
float: left;

}
</style>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.