Tricky Tricks ›› Programming Tricks ›› CSS Tricks ›› Non Tiling Background Image

Non Tiling Background Image

CSS Tricks

Non-Tiling Background Image:

Here is the CSS code to add a background image that won't tile. Place this CSS code between the <head> and </head> tags. Add a background color too for those who can't see the image.

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

You can "center" the background image on the web page but it will not stretch the image out to fill the full screen.

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

Partners