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

background-image does not appear

Status
Not open for further replies.

Pinpoint

Programmer
Joined
Dec 23, 2001
Messages
49
Location
GB
Hi,

I'm trying to display a repeating background-image in either a style-sheet, or a div, (or both). However neither will display my image.

Code is :
.head11{text-decoration:none; font-family:times new roman; font-size:20px; font-weight:normal; color:#000077;
background-image:logo.gif; background-repeat: horizontal; }

and
<div id=&quot;priceswindow&quot; style=&quot;position: relative; width: 300px; height: 540px; top:18px; overflow: auto; border-width: 1px; border-style: solid; border-color: black; background-image: logo.gif;&quot;>

Ideally I'd like to be able to use both methods.

Thanks,

Pinpoint
 
Pinpoint

The CSS notation for background images are :

[tt]background-image:url(filename.gif);[/tt]

Good luck §;O)


Jakob
 
Jakob,

Thanks. That works fine.
 
Excellent! No Prob!

Another great tip for you. Try this site. They have excellent refences for HTML and CSS. The best I've see on the web ...


Nice for a quick refence lookup!! I often use it.

Cheers §:O)


Jakob
 
Yes that site looks good, thanks.

One minor corollary. I have a table holding text, and I'm using a background-image behind the text. What I'd like to do is offset the text from the left hand edge of the table cell - ie set a left-margin, but without the background-image also being offset by that margin. Is this possible ?

Pinpoint
 
in td put style=&quot;padding-left: numberpx;&quot; to get the desired effect.
 
Thanks, that's great. Is there an equivalent &quot;padding-top&quot;. I've tried it but it doesnt seem to do anything.

Pinpoint
 
Hmmm, it does work for me. padding-left, padding-right, padding-top, padding-bottom all exist and should work on all browsers. You can also try with only the padding shorthand property, specifying the values in clockwise starting with top padding:

padding: toppx rightpx bottompx leftpx;

Probably not the best looking site, but margins, borders and paddings seem fully described:

 
Yes, does work ok. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top