Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How to make a header img a link..
Old 12-28-2007, 08:09 PM How to make a header img a link..
Novice Talker

Posts: 13
Trades: 0
Iam currently wondering how i can set an image style to be as well a link?
My header uses a style to display an image and i just want that to be come a link as well..

All help appreciated! thanks in advance!
inetiatic is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-28-2007, 09:50 PM Re: How to make a header img a link..
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Is the image a background image? If it is I don't think you can make the image a link. If the image is coded in html with the <img> tag then you just need to wrap the link around it.

I'm guessing the image is a background image. Like I said I don't think you could put the link on a background image, but you can probably get creative and add an empty div or other element to occupy the same space and wrap the link around that element.

Does your image fill the entire header? If it does wrap the link around the element that has the image as the background.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-28-2007, 10:51 PM Re: How to make a header img a link..
Novice Talker

Posts: 13
Trades: 0
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>

is the code.
It looks like there are 2 images, i have one as a background, then 1 is my logo. How would i enter the div to create a link?
__________________

Please login or register to view this content. Registration is FREE


inetiatic is offline
Reply With Quote
View Public Profile
 
Old 12-31-2007, 05:18 PM Re: How to make a header img a link..
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Nothing in that code is specifically mentioning an image. It looks like WordPress to me. The code for your logo is probably in your theme's header.php file. The default theme for WP has this in the header.php file:

Code:
<div id="headerimg">
        <h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
        <div class="description"><?php bloginfo('description'); ?></div>
    </div>
That already has a link around the logo so if your theme doesn't have the link you can follow the code above to add the link.

The basic idea is any image coded into the html just needs a link around it.

<a href="someURL"><img src="pathToYourImage" /></a>

For the background link you have to get a little creative since you can't add the link directly to the image. How you do that depends on the layout of your page. If your image is set as the background of a div you could do something like:

<a href="someURL"><div id="logo-bkgd-image"></div></a>

You'd be wrapping the link around the div that contains the background image. If the image is the background for a different kind of html element you'd wrap the link around that element.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 01-01-2008, 04:27 PM Re: How to make a header img a link..
OSWebMaster's Avatar
Super Talker

Posts: 136
Name: Scott Frangos
Trades: 0
Hi Inetiatic -

Vangogh is giving you good advice without seeing your site... but I think it would be easier to help you with a direct link to the site in question. If it's not officially online yet, maybe you can just put up a sample page and send us to it for a look?

Scott
__________________
Scott A. Frangos, Technical Writer & BlogMaster
- Blog Services:
Please login or register to view this content. Registration is FREE

- BLOG:
Please login or register to view this content. Registration is FREE

OSWebMaster is offline
Reply With Quote
View Public Profile
 
Old 01-02-2008, 08:38 PM Re: How to make a header img a link..
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Scott I think you're right about a link being helpful. I probably should have asked for one before.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to How to make a header img a link..
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35256 seconds with 12 queries