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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2009
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problwm with tag's a

    HI
    i have used tag's a to link a address. i've used it like this :

    <a ... > <img ... /><br /> <h1> example </h1></a>

    when i've validate it , this error has been showed .

    is there any problwm if i've used tag's a like this .

    thanks

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by hno2005 View Post
    HI
    i have used tag's a to link a address. i've used it like this :

    <a ... > <img ... /><br /> <h1> example </h1></a>

    when i've validate it , this error has been showed .

    is there any problwm if i've used tag's a like this .

    thanks
    The anchor (<a> tag) is an inline tag. Heading tags (<h1>, <h2>, ..., <h6>) are all block-level tags. It is invalid code to place a block-level tag within an inline tag. To resolve the issue you will need to either change from a heading tag to a span tag for that text (and style it to make it resemble the heading) or else break up that link so that one instance only contains the image and the other instance is inside of the heading tag.

    So, either this:
    Code:
    <a href=... >
      <img src=... /><br />
      <span>Some Text</span>
    </a>
    or this:
    Code:
    <a href=... ><img src=... /></a>
    <h1><a href=... >Some Text</a></h1>
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Posting Permissions

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