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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Image layover 1

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I'm trying to do something rather simple, and failing miserably... I'm sick of making a new banner everytime I make a new page for my site... so I have a template, and I just want to lay some text over it, I'm playing with z-index, but just cannot get this to work, the more I tinker, the farther I am from my answer.

Basically I want this to be an h1, I have something like this...

Code:
h1
{
color: red
}

img
{
z-index:-1
}

I dunno, I'm lost... cannot find myself a decent tutorial which actually works (the one at w3schools looks great on their site, but bonks when I copy and paste it)

Thanks for any help.

-Rob
 
Use CSS and put the image as a background for a <div>

.header {
background-image: imageURL;
background-repeat: no-repeat
}

<div class=&quot;header&quot;><h1>Some text</h1></div>




Chris.

Indifference will be the downfall of mankind, but who cares?
 
Ah lookit that, it can be just the background for the div and not the whole page... wonderful, thank you.

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top