Posted in Code Snippet CSS Jquery Tutorial

Turn a DIV into a Clickable Link

Turn a DIV into a Clickable Link Posted on November 3, 2015Leave a comment

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

Best WordPress Hosting

Recently, I was doing some modification on Techlomedia Gadgets, gadget research platform developed by me. I wanted to add few boxes with text on it. Clicking on box will open a link. This could only be done if I turn the whole DIV into a clickable link.

The DIV was something like this

This DIV also had some specified width and height. I wanted to make the whole DIV clickable. It means clicking anywhere in this DIV will open the URL mentioned in the hyperlink inside the DIV.

You can do it either by using CSS or jQuery. I am going to explain both ways.

Advertisement

CSS way:

In above way, we try hyperlink to occupy the whole DIV to make it clickable.

JQuey Way

Both ways will work without any issue. You can use as per your own choice. You should change the classes in CSS or jQuery code as per your own code.

advertisement

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!