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.
My HTML Sourcebook by Dr. Ian Graham says the same thing about using BACKGROUND in <TD>
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
Tom
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
Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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+
<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+
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.gi f"> Again, IE only...
Mark
<td background="image.gif"> IE only
<td bgcolor="#dd00ff"> All browsers
<td style="background:image.gi
Mark
BACKGROUND="..."--Specifie