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.
GeosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chewymonCommented:
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

0
chewymonCommented:
My HTML Sourcebook by Dr. Ian Graham says the same thing about using BACKGROUND in <TD>
0
GeosAuthor Commented:
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.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

TTomCommented:
Yep.

Tom
0
mgfranzCommented:
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
0
HooliganCommented:
<style type="text/css">
<!--
body {background-image: url(yourImg.jpg); background-repeat: no-repeat}
-->
</style>

<body>


that places the background image in the upper left of the screen.

if you replace no-repeat with repeat-x it tiles it horizontilly only
repeat-y same thing but vertically.

Works in Ie4.0 and netscape 4.6, don't know about any other browsers or versions though.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgfranzCommented:
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+
0
GeosAuthor Commented:
Any tips on how that would work on a cell?
0
mgfranzCommented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.