Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / July 2007



Tip: Looking for answers? Try searching our database.

Padding or Margin

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adminloozer@gmail.com - 27 Jul 2007 14:06 GMT
Hello,

I've some difficulities when using padding or margin to position an
element (alone on  page alongside other elements OR inside another
parent element).  Can I say usually I will use margin to position or
create some room between parent elements and padding to position or
create some room between a parent element and child elements like a
header with its links bar, search div, image div...
If someone can  tell me when using margin and padding it will help
me.
Ithk to all.

PS: my question is not about absolute, fixed, relative or float
position - only when to use margin or pdding to create room between
elements.
Bergamot - 27 Jul 2007 14:24 GMT
> when to use margin or pdding to create room between elements.

Margin is outside the element borders, padding is inside. Which to use
depends on your particular design. See also
http://brainjar.com/css/positioning/

Signature

Berg

Andy Dingley - 27 Jul 2007 17:38 GMT
On 27 Jul, 14:06, adminloo...@gmail.com wrote:

> I've some difficulities when using padding or margin

If in doubt, use margin.

When you've learned how it all works, start to use padding. This might
be once you start needing borders.

Learn about "Collapsing vertical margins"

The brainjar article is one of the best resource around. It's good for
explaining float too.
Gus Richter - 27 Jul 2007 19:02 GMT
> Hello,
>
[quoted text clipped - 4 lines]
> position - only when to use margin or pdding to create room between
> elements.

Use margin to position a container and padding to position the content
(away from the container). The content itself will have its own margin
and padding, allowing for additional control/needs and remember the
border between margin and padding.

Signature

Gus

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.