background no repeat (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


gskywalkers -> background no repeat (8/11/2003 16:03:28)

Is it possible to apply a CSS Style to a table background or a cell background so that the background does not repeat?




gorilla -> RE: background no repeat (8/11/2003 16:55:07)

http://www.w3.org/TR/CSS21/colors.html

Yes but what do you mean by "does not repeat?"

If you mean it does not repeat for the entire page, then no it will only appear for the specified element.

If you mean you don't want it to repeat for that particular set of cells or whatever your syntax might look like this:


<STYLE>


.style1 { background-image:url(backer01.jpg);
background-repeat:repeat }



.style2 { background-image:url(backer02.jpg);
background-repeat:no-repeat }


</STYLE>

The possible values are:

repeat
repeat-x
repeat-y
no-repeat
inherit

August 11th 2003




gskywalkers -> RE: background no repeat (8/11/2003 21:31:09)

Thanks for the quick reply. I have a background on one of my pages that uses this CSS style and the image does not repeat or "tile" as the page looks bad with more than one image displayed.
<style type="text/css">
BODY
{
background: url('images/background.gif') no-repeat;
}
</style>

So now if I have this big image on the whole page that does not "tile", is it possible to have smaller images used as backgrounds in other tables on the page? I want these images to have a washed out look so that they can be typed over with text as opposed to using just a plain color.




gorilla -> RE: background no repeat (8/12/2003 16:09:15)

Yes. Background and background image apply to all elements. You can define 20 million styles each with a different background image if you're lunatic enough to want to have twenty million different styles that you want to apply to differing elements of your page :-)

Just create a style for those cells, divs, paragraphs, etc that you want to have the different backgrounds. Use the code I gave you above as a guideline.


August 12th 2003




gskywalkers -> RE: background no repeat (8/12/2003 21:01:01)

Thanks.....I will see if I can't work with this a bit and see how I do.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625