This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > February 2006 > Re: margin, padding & border set to 0 leaves no space





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: margin, padding & border set to 0 leaves no space
bombardos

2006-02-12, 6:38 pm

I'm guessing take the "p" out in the first line?
ryansebiz

2006-02-12, 6:38 pm

Originally posted by: bombardos
I'm guessing take the "p" out in the first line?

i thought so too, but the article strongly encourages not to change that first
rule.

reason being, different browsers have different default values for those
numbers, which can ruin a design causing major problems when viewed on various
browsers.

does anyone know what rule i could add to my various "text rules" to get the
space back after the <p> tags?

ryansebiz

2006-02-12, 6:39 pm

Originally posted by: Newsgroup User

Just specify the value you want for margin on the p tag.

BTW, you don't need to write out that whole list to negate margins and
padding etc. All you need is this at the *top* of your CSS file:

* {
margin: 0;
padding: 0;
border: 0;
}

That covers all tags, so that the browser defaults are all overridden. Now,
whenever you have something you want to specify margins, padding, or border,
you can do it with the individual item.

In the case of a <p> tag, I would recommend using vertical padding, rather
than margins. This is because many browsers will push a margin (especially
top margins) outside the container and cause problems with the layout. Try
something like this:

p {
padding-top: 4px;
padding-bottom: 6px;
}

... and adjust to suit.

tim



awesome - that's exactly what i was looking for.
thank you!
*marks as answer*

ryansebiz

2006-02-12, 6:39 pm

Originally posted by: Newsgroup User
It's still damn annoying, in my opinion, and really unnecessary....

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


just trying to gather other input here - what do you recommend instead?

ryansebiz

2006-02-12, 6:39 pm

Originally posted by: Newsgroup User

I guess it really all boils down to how precisely alike you want the page to
look cross-browser. Overriding the defaults helps you there. And since the
top-margin issue is so prevalent, it's a tempting choice.

That said, I only do it on occasion.

tim



really? so do you recommend that i just forget about it and go with the
defaults?

as a tempting choice, what occasions do you go with this?

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews