Jump to content

centering div tags


droidus

Recommended Posts

i have a percentage bar, and it is not centering in my div.  here is my code:

 

<div id="outerPercentContainer" style="width: 200px; background-color:#FFF; border: 2px #000000 solid; margin-left:auto; margin-right:auto;">
    <div id="actualPercentage" style="width: <?php echo $usagePercent; ?>%; background-color:#09F; font-weight:bold;">
      <div id="percentageText" style="text-align:center; width:200px;"> <?php echo $usagePercent."% of 250 MB"; ?></div>
      </div>
  </div>

 

thanks in advance

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/244965-centering-div-tags/
Share on other sites

If I copy and paste your code  in an otherwise empty web page , replacing the php tags with actual values and putting a  standards mode-invoking doctype over it, it centers perfectly. Be it that your code only includes the blue and white part plus the black border. Not the brown part.

Link to comment
https://forums.phpfreaks.com/topic/244965-centering-div-tags/#findComment-1258684
Share on other sites

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.