![]() |
Need to make Divs hyperlinks but here is the catch...
...without using any type of Java and HTML5 compliant.
Just can't find the answer of figure it out. In other words I want a div that contains mixed media - text - images and or video and clicking on the DIV takes you to another URL. I know how to style to mouse over to work right on CSS, just can't get the hypertexting to work without Java or JQuery |
css - Make a div into a link - Stack Overflow
2nd post is what you want I believe. You need to span a large A href over the div essentially. |
Quote:
|
Maybe from "8" down :2 cents:
|
sadly, you can't add any <a> tag around divs and pass validation.. what you can do is changing the DIV tag to SPAN and you will be good to go...
Before: Quote:
Quote:
https://validator.w3.org/check Quote:
|
Thanks for the responses.
I am going to have to play with the swapping span for div to see if will work for my concept. I am playing around with some rotating / custom advertising targeted to individual surfers and want to keep it cross browser and platform compliant, is not picked up as ads by blocking software, keeps my sites mobile ready, allows A B C testing, and allows me to "follow" and "nofollow" links depending on what I am serving. I plan to be serving these across a network of sites, database driven and the java inside div was interfering with other java on the site for some browsers (rotating banners, social media, bootstrap and a chat module). |
Im typing from my phone so i cant test the code exactly.
But cant you just display the div or "a div" as display: block? the entire div should become selectable with the link within the div. You didnt post the example code youre having problems with so youre making it harder for someone to help. Show the exact code line example. |
All times are GMT -7. The time now is 08:44 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123