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!

bg img?

Status
Not open for further replies.

darkprince

Programmer
Jun 4, 2002
165
AU
hello

can anyone tell me if i can make it so that i have a background image but it doesn't stretch or repeat?

thanks in advance
ciao
 
.one { background: url("someimage.gif") no-repeat }
. . .
<td class=&quot;one&quot;>
 
thanx

but i couldn't get it to work can you tell me where to put that first one

ciao
 
I wrote a faq for this
faq215-2573

feedback would be appreciated [soapbox]
sleep is good
 
darkprince,
Place this in the <head> of your page:
<style>
.one { background: url(&quot;someimage.gif&quot;) no-repeat }
</style>

deecee,
Your FAQ contains just a basic info on this like many others that can be found easily over the web.
You could enhance it by adding examples of shortened records for styles (like I did in my post).
Or, for example, give different examples of uncommon positioning of backgrounds, like:
{ background-position: 100% 100% }
And, of course, provide info on browser support of these features. In this case your FAQ would be really helpful.
 
hey again

okay it doesn't work still, there's no pic in the bg and the pic is just a black rectangle??? weird ill post in the code im using

>--------------------------<

<html>
<head>
<title>test page</title>
<style>
.one { background: url(&quot;bg.jpg&quot;) no-repeat }
</style>
</head>
<body>
<font face=&quot;VERDANA&quot;><font color=&quot;#ff0000&quot;>hello world</font>
</body
</head>

>--------------------------<

here's a link to see it
 
You didn't apply class=&quot;one&quot; to any page element. I showed in my first post how to do it.
If you talk about bgr. image for entire page, write this in the style:

body { background: url(&quot;someimage.gif&quot;) no-repeat }

If not, apply the style to the specific element where you want a bgr. image to appear.

Also, what is this supposed to be:
</body
</head>

Fix all html errors and do exactly what you was offered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top