Jump to content

Background image link in CSS


liberti

Recommended Posts

I am trying to get my header background to link back to the main page on every page.

 

Cannot figure out where my errors are? I am very green!

 

Here is the CSS

 

#header {

 

width: 804px;

height: 150px;

left: 0px;

top: 0px;

background-image: url(/valley-files/images/header.gif);

background-repeat: no-repeat;

display: block;

position:relative;

 

}

 

 

#header span {

visibility:hidden;

left: 0px;

top: 0px;

position:absolute;

}

Here is the HTML

 

 

Thank you,

Liberti

Link to comment
Share on other sites

You will need to define the link tag to have a width and height.

 

#header a {

width: 804px;

height: 150px;

display: block;

}

 

The css is based on the fact that your header.gif file is the same dimensions as your #header div. Otherwise, you can adjust the link width and height to fit the area you want to be hyperlinked.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...