Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter gss2006

    (@gss2006)

    the code is :

    <a href="index.php"><div id="masthead"></a>

    What error? Where is this code? Where is your blog?

    (and read the instructions below how to post code ??

    I’m assuming gss2006 tried validating and got an error. Gss2006, the correct way should be:

    <div id="masthead"><a href="index.php"></a></div>

    <div id=”masthead”></div>

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    <a href="index.php"><div id="masthead"></a>

    Well, the biggest error is that div is a block element whereas anchor can only contain inline elements.

    Another big error is that it’s improperly nested. You didn’t close the div before closing the anchor, which has the div inside it. Not that it matters, because it would still be invalid even with a closed div there, due to the block/inline problem.

    https://www.w3.org/TR/xhtml1/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘what’s wrong with: <a href=”index.php”><div id=”masthead”></a> ?’ is closed to new replies.