www.webdeveloper.com
Results 1 to 5 of 5

Thread: Bit of an odd question/problem...

  1. #1
    Join Date
    Jun 2010
    Posts
    23

    Bit of an odd question/problem...

    Hey folks. I'm trying to make some buttons with css. I've got 4 <h3> tags which I've designed with css to look like buttons, then I wrapped them in <a> tags to become links, but it doesn't validate with w3.

    here's the error, which I get 4 times for each of the <h3> links.
    Line 45, Column 57:

    Document type does not allow element "h3" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    <a href="#"><h3>Unique Website Design</h3></a>


    Is it not possible to use a <h3> as a link?

    Then reason why I want to use h3 for my links, is because I'm under then impression that it may be better for SEO. If this is not the case, please let me know so I can just use a div instead.

    cheers!

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <h3><a href="#" style="display:block;">Unique Website Design</a></h3>

  3. #3
    Join Date
    Jun 2010
    Posts
    23
    Thanks, but could you possibly explain that?


    edit: didn't fix it,

    Line 45, Column 101:
    document type does not allow element "h3" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

    … style="display:block; text-decoration:none"><h3>Unique Website Design</h3></a>


    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Last edited by deXtrous; 06-17-2010 at 01:47 AM.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    The link goes INSIDE the header element. Giving the link display:block means it fills the space allocated to the header.

  5. #5
    Join Date
    Jun 2010
    Posts
    23
    Perfect thanks! sorry about that

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles