Jump to content

stretch background image


Guest cai

Recommended Posts

hi!I'm having a trouble putting background image in a webpage.At first i tried to use a simple html code but the image appeared to be tiled.So I tried to use CSS below is the line of code i've used.<style type="text/css">body{background-image: url("images/background.jpg");background-repeat: no-repeat;background-attachment: fixed}</style>...the problem with this CSS code the images doesn't stretch out to the whole screen..Is there anyway where I can make the image stretched?please help thanks!

Link to comment
Share on other sites

Hey cai,By my knowledge you cannot stretch a background image. Only way is to tile the background image and that would take all the background. Only way is to use an image editing program and change to the desired size.

Link to comment
Share on other sites

hi!I'm having a trouble putting background image in a webpage.At first i tried to use a simple html code but the image appeared to be tiled.So I tried to use CSS below is the line of code i've used.<style type="text/css">body{background-image: url("images/background.jpg");background-repeat: no-repeat;background-attachment: fixed}</style>...the problem with this CSS code the images doesn't stretch out to the whole screen..Is there anyway where I can make the image stretched?please help thanks!

Please note that this question has been answered several times. Please do a search before posting your questions.And no you cannot stretch a background image, you will have to tile it.
Link to comment
Share on other sites

Background stretching will be possible in the final version of CSS 3.0, which currently is just a draft, and not a standard. It will probably be a few years.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...