SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member lostseed's Avatar
    Join Date
    Sep 2005
    Location
    Zurconion Soon!
    Posts
    1,549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anchor a Heading?

    Validation errors for: (5 others with the same thing, same error)

    <a href="inspirational.php" title="Inspirational Mp3s"><h4>Inspirational</h4></a>

    Missing </a> before <h4> it says.

    When I place the Anchor in the H4 the sizing goes down to a little link.
    Is this the wrong way to do this?

    this is all my h4 is:

    h4 {
    font-size: 18px;
    display: inline;
    }


    Should I do

    h4, a h4 { .. etc } ?
    Then place the link inside the h4? I dont even know.

  2. #2
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The W3C error is popping up on you because it's a nesting issue. According to the specs, an inline element cannot contain a block-level element. So first, change the html:

    <h4><a href="#">Title</a></h4>

    Now you're valid we can take care of the font issue. The problem you're running into is an issue of your page's cascade. To fix the size issue, we just need to set up our CSS like this:

    a (font-size:.8em}
    h4, h4 a {font-size:1.5em}

    That should fix your problems. Let me know :-)

  3. #3
    Non-Member lostseed's Avatar
    Join Date
    Sep 2005
    Location
    Zurconion Soon!
    Posts
    1,549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This does clear up the validation problem but my text sizes are still small >>

    h4, h4 a {
    font-size: 18px;
    display: inline;
    }


    This is my default link:
    #mainbody a {font-size: 12px;}

    I also tried h4, a h4 (I think the a goes before it, either way neither change the size)

    This is starting to turn into a CSS issue more now :P

  4. #4
    Non-Member lostseed's Avatar
    Join Date
    Sep 2005
    Location
    Zurconion Soon!
    Posts
    1,549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    h4, #mainbody h4 a {
    font-size: 18px;
    display: inline;
    }


    this works, thanks pal


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
  •