Saturday, March 31, 2012

Setting Image as background

Hi,

Im trying to set an image as the background on my webpage but how do i set it up so it doesnt become tiled, i want it to strertch and fill the screen ! cheersTo stop the image from tiling you can insert the following between the <HEAD> elements of your page

<style type="text/css">
<!--
body {background-image: url(your_image_folder/your_image.jpg); background-repeat: no-repeat}
-->
</style>

This will not stretch the image though. The is no way to do this in standard HTML. An alternative is to create an enlarged image and use that as your background, or you can try using an Image control which spans the entire page and then placing all other controls on top of it, but this should be avoided if possible because it can cause headaches if a control is behind the image and it is forgotten.

hope this helps,
sivilian

0 comments:

Post a Comment