SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <h> tags and spacing

    Was wondering if there was a way to reduce the line spacing when using <h1 2 3 4 5 > tags. I use the head tags for css reasons (saves a lot of coding ) but it leaves huges gaps between the <h> text and the rest of the text.
    Hope this makes sense. Any help would be greatly appreciated.
    coiL
    "cradled in the learning curve"

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    h1 {margin: 0px, 0px, 0px, 0px; }
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks creole
    coiL
    "cradled in the learning curve"

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way, you can sete the margin for all of them at once like so:

    h1, h2, h3 etc... {margin: 0px, 0px, 0px, 0px; }
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NS4's goina give you hell for that... It likes to add the CSS margin to the default setting (sence you have the margin at 0, NS4's just goina have the default spacing).

    Also, Creole got it wrong (I've always wanted to say that...):
    Code:
    /* This will work just as well */
    h1, h2, h3, h4, h5, h6 { margin: 0px }
    
    /* Omit the commas in the in the margin property's value. */
    h1, h2, h3, h4, h5, h6 { margin: 0px 0px 0px 0px }
    The CSS margin property accepts space-separated values clockwise from the top, for instance: margin: top right bottom left. It also can accept two space-separated values for horizontal and vertical spacing, for instance: margin: horiz vert. Additionally, it can take a single value and apply it to all sides. The padding property acts the same way...

    ~~Hope This Helps

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oops. I was thinking about the selectors when I typed those commas.

    Damn, I'm starting to slip. You;d think 30 wouldn't be over the hill.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    SitePoint Guru coiL's Avatar
    Join Date
    Sep 2001
    Location
    QLD, Australia
    Posts
    666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so you don't need the commas?!

    what about for something like
    body {font: 12pt arial green;} no commas?
    coiL
    "cradled in the learning curve"

  8. #8
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    that's right no commas needed

    Sarah
    Regular user

  9. #9
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by coiL
    so you don't need the commas?!
    Not Always... To make a list of font family alternatives, you'll need 'em:
    Code:
    body { font-family: Georgia, "Times New Roman", Times, serif }
    ~~Hope That Helps


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
  •