Skip navigation

A client yesterday wanted a background image to be linked to a certain link. Well at first I didn’t know how to go about it, till I remembered in wordpress templates they usually link the header image to the homepage by:

<div id="header" onclick="location.href='<?php bloginfo('url');?>';" style="cursor:pointer;"></div>

So if you want to make a div into a link, you can do it like this:

<div onclick="location.href='http://www.yourdomain.com';" style="cursor:pointer;"></div>
Advertisement

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.