css - Make a div into a link -


I have some fancy visual content with & lt; Div & gt; to change the block which I do not want to change I want to make this a clickable link

Send me & lt; A href = "..." & gt; & Lt; Div & gt; ... & lt; / Div & gt; & Lt; / A & gt; , but that is valid XHTML 1.1.

I hope to find a better solution here, but any person giving me this offer Do not like. I think some of you have misunderstood the question. An example of how OPP wants to make a division with content behaves like a link, an example would be a Facebook ad - if you see it, they really are the proper markup.

There are no numbers for me: JavaScript (should not be required only for one link, and very bad SEO / access); Invalid HTML.

In short it is:

  • Create your panel using general CSS techniques and valid HTML
  • There is a link in it Want to be linked if the user clicks on the panel (you can also do other links).
  • Inside that link, empty span tags ( , no and - Thank you
  • Give the position of the panel: Relative
  • Apply the following period to an empty period:

     < Code> {position: absolute; width: 100%; height: 100%; top: 0; left: 0; Z-index: 1; / * IE 7/8 ensures overlap error, make sure you have A blank GIF * / background image is: url ('empty.gif');  

    This panel will now be covered, because It's inside a and lt; a & gt; tag, it's a clickable link

  • Enter another link inside the panel position: relative
to bring an appropriate z-index (> 1) to the default span link.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -