1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

wrapping a href around a div

Discussion in 'CSS' started by johnmr, Sep 19, 2006.

  1. #1
    is it possible to wrap a <a href...> tag around a <div> to make the whole thing a link? Any help appreciated.
     
    johnmr, Sep 19, 2006 IP
  2. grobar

    grobar Well-Known Member

    Messages:
    642
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Is it possible? - probably yes.
    Is it advisable to do so? - probably no.
    Reason? - One can beleive without a reasonable doubt that since this is not valid html (or xhtml) structure, it is possible that search robots will read the <a> tag, think "Oh - here is a link, lets look for the anchor text" BUT - when it runs in to an opening div tag it may terminate the thought process.

    There is hope - if what you are doing is similar to wrapping the <a> tag around an <img /> tag, then it may be fine.

    ....What do you plan to have inside the <div> tag, and before the closing </a> tag?
     
    grobar, Sep 19, 2006 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    No! An a element may contain only elements of type %inline. The div element is block.

    Instead of asking how to do what you've decided is the solution, describe your problem, along with the code you've developed so far.

    cheers,

    gary
     
    kk5st, Sep 19, 2006 IP