Responsive backgrounds with Twitter Bootstrap?

后端 未结 4 1327
不知归路
不知归路 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-29 18:20

    You can invest in a little jquery to change your backgrounds based on the screen size. Here is an example of what you can do:

    if ( $(window).width() < 1000 ) {
        $('body').css('background','url("yourimage")';
    } else {
        $('body').css('background','url("yourimage")';
    }
    

    Would you mind telling us what you've tried if you have a moment?

提交回复
热议问题