Responsive backgrounds with Twitter Bootstrap?

后端 未结 4 1332
不知归路
不知归路 2020-12-29 17:14

I would like to have a responsive image arrangement for backgrounds on a site.

For example, based on different screen resolutions, I would like for different backg

4条回答
  •  爱一瞬间的悲伤
    2020-12-29 18:01

    You could use the CSS3 Full Page Background Image explained over here on CSS-Tricks, and then go with a jQuery Fallback if necessary. There's a good article for the jQuery method over on Gaya Design Blog

    CSS:

    html { 
        background: url(images/bg.jpg) no-repeat center center fixed; 
        -webkit-background-size: cover;
        -moz-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
    

    using the @media query method specified by @apttap along with this CSS snippet you could use multiple background images per device pixel ratio.

提交回复
热议问题