Stretch and Scale a CSS image Background - With CSS only

Posted by Fábio Antunes on Stack Overflow See other posts from Stack Overflow or by Fábio Antunes
Published on 2009-07-19T15:51:52Z Indexed on 2010/04/04 16:53 UTC
Read the original article Hit count: 1075

Good day.

I always wanted to do this.

I want that my background image stretch and scale depending the Browser view port size.

I've seen some questions on SO that do the job, this One for example. Works well, but i want place the img in the background way, not with a image tag.

In that one is placed a img tag, then with CSS we tribute to the img tag.

width:100%; height:100%;

It works, but that question is a bit old, and states that in CSS3 resizing a background image will work pretty well. I've tried this example the first one but i didn't workout for me.

Does somebody know a good method to do it with the background image statement?

If its sounds confusing just ask.

Thanks

© Stack Overflow or respective owner

Related posts about css

Related posts about css-layout