Skip to content

Creating a clickable div tag

March 26, 2013

Working out how to create a clickable div tag isn’t as easy straight away to code out, if it consists of various images inside for instance. One way that i had found to make sure that a div tag is clickable is obviously to allow the cursor to be shown that it can be clicked. This example shows how you can redirect the div tag to the BBC website with the style cursor as pointer.

<div onclick="location.href='http://www.bbc.co.uk';" style="cursor: pointer;"></div>
You can do this within the whole outer div tag aswell as any components inside like a tags or images.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: