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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    <hX> - Block-level elements and links?

    Hi!

    Is it correct that <hX> is a block-level element?

    If so, the W3C validator won't allow me to insert the a href tag around it. How would I then link it?

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    Give the anchor the same display values as the Hx element.
    Adding an onclick handler to the Hx would allow you to keep the Hx, but JavaScript disabled browsers would have no link.

  • Users who have thanked Fang for this post:

    CaptainB (10-13-2007)

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Fang, thanks for the answear.

    Had not thought about it that way, thanks!

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Unless I missing something why not just put the link inside of it?
    Code:
    <hX><a href="#">Some link</a></hX>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    CaptainB (10-13-2007)

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Oh boy...I feel embarassed!

    Thanks Aerospace! It's amazing how easy "easyness" can cheat you once in a while..


  •  

    Posting Permissions

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