#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Tennessee
    Posts
    25
    Rep Power
    0

    Removing Space Between Paragraphs


    What is the correct way to remove the space between paragraphs?

    I have p { margin-top: -12px; } but IE/Win appears to be clipping the top of the topmost paragraph containers.

    What is the most compatible way to do this?
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    Most block elements have margin and/or padding by default, and that's what you need to remove.
    Code:
    p
      {
      margin: 0;
      }
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    Tennessee
    Posts
    25
    Rep Power
    0
    Thanks! I haven't been able to check it in other browsers yet, but I think that did it.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    18
    Rep Power
    0
    Yes, you can also use padding: 0; if margin isn't the one you're looking for. Padding is internal space and margins are external space.
  8. #5
  9. Prisoner of the Sun

    Join Date
    Jul 2004
    Location
    The Mews At Windsor Heights
    Posts
    5,309
    Rep Power
    2351
    Code:
    p { display: inline; }
    Might have the same effect.
    .
    :: My blip.fm tunes :: Web Design Feeds :: Web Dev Feeds :: CheatSheets :: PHP :: MySQL :: 13 Moon FB App.

    "All matter is merely energy condensed to a slow vibration. We are all one consciousness experiencing itself - subjectively. There is no such thing as death, life is only a dream. We are the imaginations of ourselves."
    - Bill Hicks


    "Truth is hidden in the subtle nature of the heart of everything, although it is invisible. One cannot see it from inside and neither from the surface. One can only live and experience it."
    - Heart Sutra
  10. #6
  11. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1100
    Originally Posted by b3n
    Code:
    p { display: inline; }
    Might have the same effect.
    ... but changes the properties altogether.
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    0

    How I set margin and padding to 0 for everything


    If you have tried all these suggestions without a result (like I did) try putting this:

    * {
    margin: 0;
    padding: 0;
    }

    in your CSS file.

    Then use padding: bla bla bla bla; to define the spaces you want in-between H1, H2 and Paragraphs as I did for searchourworld.com

    Hope that helps. :-)

IMN logo majestic logo threadwatch logo seochat tools logo