Link to home
Start Free TrialLog in
Avatar of Geos
Geos

asked on

Background images

How does one keep a background image from tiling?  Mainly I'm looking for in a table cell, but a for a main background image would work as well.
Avatar of chewymon
chewymon

As long as it is listed as <body background="some.gif"> it will tile.  The following line is from the html quick reference.



BACKGROUND="..."--Specifies an image to be tiled as background

My HTML Sourcebook by Dr. Ian Graham says the same thing about using BACKGROUND in <TD>
Avatar of Geos

ASKER

Hmmm...so the only way to have a background not tile is to make the image's canvas large enough to cover what I want.
Yep.

Tom
Avatar of Mark Franz
I believe you can use a style sheet reference to locate a background image, but then again, the only way I know of to NOT have the image repeat, is either locate the image and Zindex it to 0, or put it in a <td> tag and layer it, (NN)

Mark
ASKER CERTIFIED SOLUTION
Avatar of Hooligan
Hooligan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hooligan, just to follow up on what you propose, you can also locate the background image in the style sheet by using the background-position: attribute, i.e. with your example;

<style type="text/css">
<!--
body {background-image: url(yourImg.jpg); background-repeat: no-repeat; background-position: center top}
-->
</style>

You can also specify percentages, length, left, right, center and bottom.

Reference: http://www.w3.org/TR/REC-CSS1#background-position

Mark

P.S. The position tag does not work with NN 4+
Avatar of Geos

ASKER

Any tips on how that would work on a cell?
yeah, just set the background color or image of the cell either with a style sheet or inside of the cell tag;

<td background="image.gif"> IE only
<td bgcolor="#dd00ff"> All browsers

<td style="background:image.gif"> Again, IE only...

Mark