SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remove blank line beneath H1, H2 etc

    Can someone tell me the CSS to use to remove the blank line space I always get beneath H1, H2 etc.

    Many thanks

    Accel

  2. #2
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello

    *{padding:0;margin:0:} removes the default padding and margins

  3. #3
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by all4nerds
    hello

    *{padding:0;margin:0;} removes the default padding and margins
    That's for every element though. (fixed the error before the closing brackets)

    If you just want to remove the space for your headings, then use something like:

    H1 {padding:0; margin:0;}

    H2 {padding:0; margin:0;}

    Nadia

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    ohio
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or just combine all headings into one rule. ( basically user preference on how to code )

    h1,
    h2,
    h3,
    h4 {
    margin: 0;
    padding: 0;
    }

    To be very honest, it is always good practice to set all margins and padding to 0 using the

    * {
    margin: 0;
    padding: 0;
    }

    This will allow you to be able to control everything in pretty much every browser instead of relying on their default values. But like I mentioned previously, it is really a user preference in coding practices IMO.

    HTH


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
  •