Jump to content

background-image strech problem


Lody

Recommended Posts

Hy,

 

I've got a ploblem with the size of my background image. I want is to fit the whole screen when somebody opens my page but somehow I can't get it to work.

 

I've got in mijn HTML page:

 

3s

rge

 

Edited by Lody
Link to comment
Share on other sites

For starters, you're missing the opening body tag.

 

I am viewing at a resolution of 1280 x 1024, and I see the image repeating horizontally. For starters, set it to no-repeat, but if you get to it always adjust to 100% of any resolution, it'll be pretty distorted on some. It might be better to use it as the background of a set width/length division. Also you might want to consider that text over background images is often very hard to read.

Link to comment
Share on other sites

It's probably the same to you because your resolution isn't any larger than the image width. I now only see it once. but there's a while background peeking out on the right side of it - approx. 110px wide.

Link to comment
Share on other sites

Here's an example which stretches. Make your viewing window smaller and drag the window wider and narrower. The image will always be full width and the height will adjust accordingly.

 

It doesn't work in IE6.

 

http://www.wickham43.net/backgroundfullwidthflexible.html

 

Edit: it does work in IE6 except that the image scrolls with the page, whereas in modern browsers it's fixed to the top.

Edited by Wickham
Link to comment
Share on other sites

Hi Wickham,

 

Than I n eed to add something like Daimler Dart to my HTML code and I woulke like to do all the background work in the CSS. Do you know an other solution?

 

No, because a background-image in the CSS stylesheet cannot stretch; you have to use a code with a normal image in the html markup to get it to stretch.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...