reason808 Posted October 24, 2011 Share Posted October 24, 2011 I tried to re-create a simple box model following the w3school's code. It looks wrong. The content box has top and bottom padding while the L & R sides go straight to the border. I've coded the padding to have 0px. I've checked my code, basically w3school's with a few tweaks, and it appears correct. But I'm a noob. Nothing in box model basics tutorials mentions this type of padding display. I don't understand the display behavior and don't know where to change it. I'm running Mac 10.6.8 and firefox 6.0.2. Same display behavior in Safari 5.0.5 Any help appreciated. Source Files attached. BoxModel.html Link to comment Share on other sites More sharing options...
Don E Posted October 24, 2011 Share Posted October 24, 2011 Because your text is inside a paragraph, <p> tag by default has margin what you're pointing to in the attached thumbnail. For the <p>, try: margin:0; Should go away. Link to comment Share on other sites More sharing options...
reason808 Posted October 24, 2011 Author Share Posted October 24, 2011 Thanks a lot!! It went away. I understand better. Follow up Q: I suspect I'll be fighting these default settings. Is there a list of these default margins with visual examples anywhere on the web? What terms would I be searching for? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.