Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

applying css with image as a header

Status
Not open for further replies.

Programmer2006

Programmer
Jun 29, 2006
12
US
Hi all I am trying to add my banner image as a header in css but it doesn't work and I don't know why. here is the css:
.............................................
body{
background-color:#8470ff
}
p{
color:darkred;

}
a{
text-decoration:none
}

.banner {
background-image: url(images/Banner2.gif);
background-repeat: no-repeat;
background-position: center top
}
.............................................
Here is the html:
...........................................
<html>
<head>
<title>MyTitle</title>
<link rel="stylesheet" type="text/css" href="body.css"/>
</head>

<body text="660000" link="ffffff">
<div class="banner"></div>
</body>
</html>
 
provide a width and height for your div, or add content to the div. an empty div with no static height or width has no size, so you won't see the background image.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
If you have no content to go in the header div then you probably shouldn't be putting the image in the background.

Put your header image in as a regular <img> tag with a suitable alt attribute and possibly wrap it in a link to your homepage too.

<honk>*:O)</honk>
Designease Ltd. - polyprop folders, ring binders and creative presentation ideas
Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top