Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    84
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Line spacing between tags

    What's the best way to line space between different tags? (ie. an h1 and h2)? I know line-height works with the same tags, but I'm trying to find a way to do it without doing a negative top margin.

    For an idea I'm trying to emulate the two lines from this webpage (http://www.pixelbot.ro/) that say "Making sites / so you don't have to". Granted, it's an image, but looking for the CSS way.

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,269
    Thanks
    10
    Thanked 277 Times in 276 Posts
    Just set the top and bottom margins and padding on the h1 and h2 objects so that they're the distance apart that you want.

    Dave

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    84
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Just set the top and bottom margins and padding on the h1 and h2 objects so that they're the distance apart that you want.

    Dave
    Thanks, I guess that's an easy solution.


  •  

    Posting Permissions

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