can someone plese clarify how to set width for an html document.
i have set the width for my body tag and even made a wrapper div to set the width but still the page is running a few pixels wide?
what am i doing wrong?
can someone plese clarify how to set width for an html document. i have
Share
To follow up on what @pekka said:
Browsers have different default styles, and this likely explains the extra margin or padding that you’re seeing. For your css to behave as you expect, it’s generally adviced to reset your css. In short, but defining certain styles across all elements, you eliminate these browser inconsistencies and can then trust that your styles will cascade as you want them too. This is why setting the margin on the HTML and BODY elements eliminates the extra space mentioned in the question.
Eric Meyer has good thoughts on this, and his reset is the one I’ve seen most frequently used across the web. However, it should be noted that the extensive example below shouldn’t be used without though. Tweak it to fit your project’s needs
Ex (From Eric Meyer’s Reset, link below):
Check out these discussions for a more detailed explanation:
http://meyerweb.com/eric/tools/css/reset/
http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/