SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    What Are The Default Margins For Links (and all CSS)

    Sitepoint Members,
    I want to put a little extra space vertically between links. When there's no starting point (don't know the default margins) it's time consuming to work out via trial and error all four margins to look like what I want. What are the CSS default margins (top bottom left right) for links (and everything else in CSS) . If, for example, the default magins were 1 1 1 1 (whatever units) all I'd have to do is change it to 2 1 1 1 and see how it looks. Without knowing 1 1 1 1 you have no starting point. Using margin-top:2, would help a lot, but not knowing the default units, you might choose a unit different than the default. Do really want that? Defaults should be available someplace.

    Thanks,

    Chris

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Links are inline elements, so they don't have any margins. To apply margins to them, you'd need to set them to display: block ... but that's only useful if they are in something like a menu.

    There are no standard default margins on block elements. Each browser has its own defaults ... which is why it's tempting just to zero out all margins in a single reset at the top of the style sheet.

  3. #3
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    638
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Oh well. I have the zeroing out of margins.

    Thanks Ralph.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •