Solved

Booststrap two images depending on screen size

Posted on 2015-02-10
2
150 Views
Last Modified: 2016-02-25
Hi, If I have an image that goes across the whole screen, like here:  diabetic-meals.net/responsive/index.html

And if it had text on the image, I would want it to be the same image for large and medium screens, but when it got to cell-phone size, I'd like to put a different image there. How do I go about that? Thanks, I can't seem to google search this with the right question.
0
Comment
Question by:mel200
2 Comments
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
Comment Utility
Without Bootstrap, you would put two images in the page with different classes, then use a media query to set style "display: none;" or "display: block;" ("display: auto;" might work better than block?) so that only one of them displays at once.

Using Bootstrap 3,  I think you can just apply style "display: none;" and class "visible-xs" to the image for phones, and class "hidden-xs" for the image for everything else. Docs for this: http://getbootstrap.com/css/#responsive-utilities
0
 

Author Closing Comment

by:mel200
Comment Utility
That's what I was looking for, thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now