I need help keeping background images from tiling in webpages

M

Mr. Ass

Guest
Alright the title basically describes it... The background image im dealing with is attached to this thread. I want to keep it from tiling because it just wont look right (since i want to keep the red at the top of the page only)... This was the closest solution i could find but it didnt work because the background image i have will be within a table only.

Code:
<STYLE TYPE="text/css">

<!--

BODY { background-image: url(myimage.jpg) }

BODY { background-repeat: no-repeat }

BODY { background-position: center }

-->

</STYLE>
 
I think tiling is the default feature for the backgrounds .. in order to keep it from doing it you could try this:
  • make a layer - put the top part as the background and ajust it to wear you want it at
  • Make another layer and put the rest in the background of that one ....
I had a simular prob with dreamweaver and that was the only way I could fix it ..

I hope you figure it out ..
 
Originally posted by Quantum Thunder
Alright the title basically describes it... The background image im dealing with is attached to this thread. I want to keep it from tiling because it just wont look right (since i want to keep the red at the top of the page only)... This was the closest solution i could find but it didnt work because the background image i have will be within a table only.

Code:
<STYLE TYPE="text/css">

<!--

BODY { background-image: url(myimage.jpg) }

BODY { background-repeat: no-repeat }

BODY { background-position: center }

-->

</STYLE>

I assume by your attached pic that you'd like to tile it horizontally, but not vertically, right? If so, use the following style:

BODY {
background-image: url(myimage.jpg);
background-repeat: repeat-x;
background-color: black;
}

Then, you can trim that image down really small so it won't take so long to download for those with slow connections. The image will tile right to left, but not down. Since the lower part of your image is black, setting the background color to black will blend in with the image. I've attached the new smaller image too.

Edit: Oh yeah, almost forgot: This may or may not work well in the older Netscape 4.x browsers (but fine in versions 6 and up). If that's an issue, you'll have to do something a bit more exotic.
 
Since it's supposed to be a background to a table and not to the BODY tag I suggest you apply the CSS to the TABLE tag instead.
Code:
TABLE {
background-image: url(myimage.jpg);
background-repeat: repeat-x;
background-color: black;
}

Or better yet, a specific TABLE tag, since you might want tables without the background. ;)
Code:
TABLE.withbackround {
background-image: url(myimage.jpg);
background-repeat: repeat-x;
background-color: black;
}
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back