Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load images based on screen size in Boot Strap 3

I am using Boot Strap 3 for my new responsive layout. For my home page I have background image. Please advise how to use different background images depending on screen resolution. I cannot use responsive class. Please use below URL to review the layout.

http://idea66.com/mobile/screenshot.png

If I create this structure for different screen type, how can we call them using Boot Strap 3.0

Thank you Monica

like image 665
user3148906 Avatar asked Dec 31 '13 14:12

user3148906


People also ask

How do I make an image fit the screen in Bootstrap?

Bootstrap has the built-in img-responsive class for this purpose. This applies max-width: 100%;, height: auto; and display: block; to the image so that it scales nicely to the parent element. Show activity on this post. I've been trying this morning a bit and I finally got it to work.

How do you make image responsive using Bootstrap?

To make an image responsive in Bootstrap, add a class . img-responsive to the <img> tag. This class applies max-width: 100%; and height: auto; to the image so that it scales nicely to the parent element.

How can set width and height of image in Bootstrap?

Images in Bootstrap are made responsive with . img-fluid . max-width: 100%; and height: auto; are applied to the image so that it scales with the parent element.

Which class will you use to create a responsive image that changes its width based on the browser width?

Create responsive images by adding an . img-responsive class to the <img> tag. The image will then scale nicely to the parent element.


1 Answers

You can have CSS with media queries. Example:

@media (max-width: 979px) {

    body {
        background: white url(medium.jpg);
    }

}

@media (max-width: 767px) {

    body {
        background: white url(small.jpg);
    }

}
like image 190
Mikko Ohtamaa Avatar answered Nov 11 '22 06:11

Mikko Ohtamaa