Table Of Content
- You can’t make the div a link itself, but you can make an tag act as a block, the same behaviour a has.
- Requires a little javascript. But, your div would be clickable.
- This is a “valid” solution to achieving what you want.
- HTML
- CSS
- Open in new window
- Open in same window
- The code
- This is one of the solution
- Try this code
- You can give a link to your div by following method
- You can make surround the element with a href tags or you can use jquery and use
- We have a block with some fancy visual content that we don’t want to change. we want to make it a clickable link.
- It something like
…, but that is valid XHTML 1.1.-
You can’t make the div a link itself, but you can make an tag act as a block, the same behaviour a
has. [pastacode lang=”css” manual=”a%20%7B%0A%20%20%20%20display%3A%20block%3B%0A%7D%0A” message=”Css Code” highlight=”” provider=”manual”/] [ad type=”banner”]You can then set the width and height on it.
-
Requires a little javascript. But, your div would be clickable.
-
This is a “valid” solution to achieving what you want.
But most-likely what you really want is to have an tag displayed as a block level element.
-
HTML:
-
CSS:
Open in new window :
- Here’s how to make a div into a clickable link that will open the target URL into a new window.
[ad type=”banner”]
Open in same window :
- Here’s how to make a div into a clickable link that will open the target URL into the same window.
-
The code :
- You could also try by wrapping an anchor, then turning its height and width to be the same with its parent.
-
This is one of the solution :
[ad type=”banner”]
-
Try this code :
-
You can give a link to your div by following method:
[ad type=”banner”]
-
You can make surround the element with a href tags or you can use jquery and use
-
- It something like
