Make your own free website on Tripod.com

Background Image Position

Ever wondered how you could stop a image from repeating itself? These tricks will show you how.

Example:




The above image does not repeat.

Copy & Paste the following code in the HEAD section of your webpage.


 <style type="text/css">
 <!--
 BODY {background: url(yinyang.gif) no-repeat}
 -->
 </style>

You can also align the image, the following code shows how.

Copy & Paste the following code in the HEAD section of your webpage.


 <style type="text/css">
 <!--
 BODY {background: url(ball.gif) no-repeat center}
 P {background: url(ball.gif) no-repeat left}
 DIV {background: url(ball.gif) no-repeat right}
 -->
 </style>

Or specify the direction where the image can repeat.

Example:

repeat-x


                repeat-y






Copy & Paste the following code in the HEAD section of your webpage.


 <style type="text/css">
 <!--
 BODY {background : url(yinyang.gif) repeat-x}
 P {background : url(yinyang.gif) repeat-y}
 -->
 </style>

And you can also specify its alignment.

Copy & Paste the following code in the HEAD section of your webpage.


 <style type="text/css">
 <!--
 BODY {background: url(yinyang.gif) repeat-x center}
 P {background: url(yinyang.gif) repeat-x left}
 .fancybox {background: url(yinyang.gif) repeat-x right}
 -->
 </style>