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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.