Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 06-30-2007, 01:25 PM The <p> tag.
Junior Talker

Posts: 2
Name: Jason Stanley
Trades: 0
It seems that many browsers style the <p> tag using margin instead of padding. This can easily mess up a background when put on a specific div. Instead of backgrounding the whole div you are often left with an annoying blank part at the top.

The obvious fix to this is.

p {margin:0px; padding:15px 0 0 0;}

Are there any situations where this would present a problem in the visual appearence webpage?

If no problems arise from this then does anyone know why browsers use margin instead of padding when it comes to <p>?
Bigs is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-30-2007, 04:55 PM Re: The <p> tag.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
It seems that many browsers style the <p> tag using margin instead of padding.
No, as far as I know they all render the lowly <p> tag exactly the same way. A <p> is a block-level element.

Adding margin to the <P> should have no affect on the background of the div it sits in. That 'annoying blank part' is most likely due to margin collapse, which isn't a bug BTW, and can be solved by putting a 1px top padding on the containing div.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to The <p> tag.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19561 seconds with 12 queries