Using CSS to Display a Non-Tiling Background Image within a Web Page
If you would like to display a background
image on your web page, but don't want it to tile (repeat), place the following
code between your <HEAD> and </HEAD> tags. This code will prevent
your image from tiling and will center it within your page.
<STYLE
TYPE="text/css">
<!--
BODY { background-image:
url(yourimage.jpg) }
BODY { background-repeat: no-repeat }
BODY { background-position: center }
-->
</STYLE> |
Copy and paste
the above code into your HTML between your <HEAD> and </HEAD>
tags. The text in red should lead to the image on your web server.
Please note: The image must reside on your
web server. If your image is in a different directory than your web page,
you must also include the directory name in front of your image name.
Example: images/yourimage.jpg
More Web Design
Tips |