The EWJ Database > When I'm Bored Script Series > Tiling a Picture In One Direction
|
Tiling a Picture In One DirectionCSS 1 (Cascading Style Sheets) provides the background-repeat attribute for tiling a picture. I noticed that when using this attribute to tile a picture in the <BODY> tag, the picture is not displayed at all. This is a way around it. For this, you will need a browser with full support of CSS 1. For information on CSS 1, click here. First, create your page. I will show a really basic one here: <HTML> I will take this page and add the small bit of code that will make the background repeat in only one direction. You can leave the BACKGROUND attribute, make the BACKGROUND refer to a picture that is specifically designed for standard tiling, or have no background at all. The CSS background will always be shown on CSS 1-enabled browsers and the standard background will be shown on browsers without support for CSS. <HTML> The repeat-y attribute can be changed to any of the following:
All of what was mentioned can be put in any tag that covers a span of text, such as <A>, <B>, <P>, <DIV>, <SPAN>, etc. I wouldn't try it in tags which do not require a closing tag, such as <IMG>. |