GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech Need to make Divs hyperlinks but here is the catch... (https://gfy.com/showthread.php?t=1169645)

suesheboy 07-05-2015 11:51 AM

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

Relic 07-05-2015 12:29 PM

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.

suesheboy 07-05-2015 02:48 PM

Quote:

Originally Posted by Relic (Post 20516201)
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.

From what I see that is not Valid HTML.

NatalieK 07-05-2015 06:22 PM

Maybe from "8" down :2 cents:

zerovic 07-06-2015 04:03 AM

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:

<a href="http://www.google.com/" title="test"><div id="content">This is a test</div></a>
After:
Quote:

<a href="http://www.google.com/" title="test"><span id="content">This is a test</span></a>
You can always check your code at
https://validator.w3.org/check

Quote:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 5 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<a href="http://www.google.com/" title="test"><span id="content">This is a test</span></a>
</body>
</html>
Hope it helps.

suesheboy 07-06-2015 05:39 AM

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).

MetaMan 07-06-2015 05:48 AM

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