Jump to content
  • Advertisement
Sign in to follow this  
shadowstryker

[web] CSS - 100% width is not 100%

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using the following code: CSS
#buttonbar {
   background-image: url(art/buttonbarbg.jpg);
   background-repeat: repeat-x;
   background-position: top left;
   border: 1px solid #000000;
   width: 100%;
   height: 60px;
   float: left;
   overflow: hidden;
}
HTML
   <div id='buttonbar'>&nbsp;</div>

For some reason, when viewed in FF this extends 2px past the edge of the normally viewable area, whereas in IE it displays as intended.

Share this post


Link to post
Share on other sites
Advertisement
Firefox follows the CSS spec and extends borders 1 pixel beyond the box size. IE, however, does not do this. IE adds a 1 pixel border inclusive of the box size.

---
Michael Tanczos

Share this post


Link to post
Share on other sites
Add the correct doctype to force IE to standards mode.

Actually, if you're going for 100% width -- do nothing. Divs are always the full width of the container that they're in (i.e. width: auto).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!