SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <h1> <h2> spacing issues

    ok i am trying to get my site google ready with h1 and h2 tags and i am having a problem getting the h2 to have proper spacing under and over the text links

    here is the file to see what its showing and what i have come got...

    the top is the "over spaced version" and the bottom is the proper look i want (only with h2 tags)...

    and here is the h2 css code

    h2 {
    font: bold 12px Arial, Tahoma, Verdana, Helvetica, sans-serif;
    }

    h2 a {
    font: bold 12px Arial, Tahoma, Verdana, Helvetica, sans-serif;
    margin-top: -10px;
    }

    can anyone help? linespacing isn't working

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Is it just the <h2> tags, or other content (i.e. paragraphs) next to the <h2> tags that is causing the spacing issues?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pull the h2 tags out and it looks like the nav under it

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Boston
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think an unordered list would be more appropriate...
    -Lewis

  5. #5
    SitePoint Member lazydog's Avatar
    Join Date
    Sep 2003
    Location
    on the farm
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what if you start the <H2> tag before New Beetle and then put the </H2> after Bus-Camper with a <BR /> after each link in between

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    try setting both margin and padding on the H2 to 0

    and yes, a UL would also work, but who knows, maybe google likes H2s a wee bit more
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Zealot ComputerBob's Avatar
    Join Date
    Jul 2003
    Location
    USA
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use a bunch of h2s that aren't in a ul, they won't validate for Web accessibility requirements. Those requirements forbid having two or more links that are separated only by spacing, because they're confusing to people who use browsers that read the links out loud.

    If you put the h2s into a ul, they'll validate for accessibility. Then style the ul as suggested above, to get rid of extra padding/margins.
    ComputerBob - Making Geek-Speak Chic™
    http://www.computerbob.com
    - XHTML 1.0 Strict + CSS Layout
    Ratings | Forums | Software | Polls | Weird | Quotes | Weather
    Guest Articles | Free Greeting Cards | CB Awards | Search

  8. #8
    SitePoint Zealot
    Join Date
    Nov 2002
    Location
    canada
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like mentioned above, trying margin. you can set negative files to pull it up
    HostVoice.net - When Hosts Compete, You Win
    Looking for a web host? Let them compete for your business.
    Submit a free request and receive offers within 15 minutes
    from qualifying hosts - Personal, business, NT, dedicated!

  9. #9
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try { margin:0; padding:0; } or something like that. But what you have there is a typical <ul> list with items, not headers.


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
  •