Need some basic HTML help, please.

El Guaraguao

Diamond Member
May 7, 2008
3,468
5
81
First off, I suck at HTML. Now that we got that out of the way, Im looking to have my site header picture\banner also link to the home page. ya know kinda like the AnandTech.gif, up on the top left side of this board.

Heres the header info from my style.css

#header
{
margin-bottom: 0px;
margin-top: 0px;
text-align: center;
padding-top: 0px;
background: #ffffff url("logo.png") top center no-repeat;
height: 130px;
}

So how can I hyperlink logo.png to the homepage?
 
Oct 27, 2007
17,009
1
0
<a href="link.html">
<div id="header">
your banner stuff here
</div>
</a>

I think that will do it, but it's been a while.
 

dwell

pics?
Oct 9, 1999
5,185
2
0
You can use Javascript to do it. You can't really hyperlink a div:

Code:
#header
{
margin-bottom: 0px;
margin-top: 0px;
text-align: center;
padding-top: 0px;
background: #ffffff url("logo.png") top center no-repeat;
height: 130px;
cursor:pointer;
}

<script type="text/javascript">
// using jquery
$("#header").click(function() {
    document.location = "/";
});
</script>

Something like that.
 
Oct 27, 2007
17,009
1
0
Also it's not totally necessary to have your banner as a BG image, that's just some arbitrary thing that CSS snobs do.
 

xanis

Lifer
Sep 11, 2005
17,571
8
0
Keep it simple. Set your image size, make a div of the same size called "header". Insert the image with the <img src> tag, then make it a link. Done.

Code:
<div id="header">
   <a href="index.html"><img src="image.jpg"></a>
</div>
 

El Guaraguao

Diamond Member
May 7, 2008
3,468
5
81
Keep it simple. Set your image size, make a div of the same size called "header". Insert the image with the <img src> tag, then make it a link. Done.

Code:
<div id="header">
   <a href="index.html"><img src="image.jpg"></a>
</div>

This works. Thank you and thanks to everybody who replied.
 

El Guaraguao

Diamond Member
May 7, 2008
3,468
5
81
Im back. I just checked out the other pages on my site, and none of them have my logo.png. Its just blank, not even a place holder. I used the code that xanis provided on my index.php to get the logo.png to show up on my homepage. (I dont have a index.html)

Im also using wordpress.

What file do I place xanis html code and where exactly do I place it?

Thanks.
 

El Guaraguao

Diamond Member
May 7, 2008
3,468
5
81
The code that xanis provided;

Code:
<div id="header">
   <a href="index.html"><img src="logo.png"></a>
</div>

This code only works for my homepage. When I load the other pages, there is no logo.png. I need this logo to load on top of all pages.
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
He's using wordpress, he's said as much - certainly that has a template option built in that doesn't require using php. That is the whole point of a CMS, is it not?