Need to make Divs hyperlinks but here is the catch...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suesheboy
    Confirmed User
    • Nov 2002
    • 5211

    #1

    Tech 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
    Adult Web Site Domain Names For Sale
    Adult Sex Toy Domain Names For Sale
    Tantric Delights, Sex Toys Blog, Tantric Sex Toys
  • Relic
    So Fucking Banned
    • Aug 2002
    • 10294

    #2
    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.

    Comment

    • suesheboy
      Confirmed User
      • Nov 2002
      • 5211

      #3
      Originally posted by Relic
      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.
      Adult Web Site Domain Names For Sale
      Adult Sex Toy Domain Names For Sale
      Tantric Delights, Sex Toys Blog, Tantric Sex Toys

      Comment

      • NatalieK
        Natalie K
        • Apr 2010
        • 19916

        #4
        Maybe from "8" down
        My official site / Custom vids / Make money links / First time girls
        Email: [email protected] - "Converting traffic into income since 2005"

        Comment

        • zerovic
          Confirmed User
          • Apr 2010
          • 1115

          #5
          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:
          <a href="http://www.google.com/" title="test"><div id="content">This is a test</div></a>
          After:
          <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

          <!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.
          php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com

          Comment

          • suesheboy
            Confirmed User
            • Nov 2002
            • 5211

            #6
            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).
            Adult Web Site Domain Names For Sale
            Adult Sex Toy Domain Names For Sale
            Tantric Delights, Sex Toys Blog, Tantric Sex Toys

            Comment

            • MetaMan
              I AM WEB 2.0
              • Jan 2003
              • 28682

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

              Comment

              Working...