Using CSS to Display a Non-Tiling Background Image within a Web Page
|
You can use
CSS (Cascading Style Sheets) Style Tags to display a non-tiling background
image within your 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
This is just
one small example of how you can use CSS (Cascading Style Sheets) Style Tags
within your web page. For additional information on CSS, visit the
CSS Tutorial
section.
More Web Design
Tips |