Saturday, April 25, 2015

Bootstrap Visibility

BOOTSTRAP AND VISIBILITY

Bootstrap offers you the ability to show or hide content based on both screen size and printing state. The syntax is, as with much of Bootstrap, option-screen.
The two options are either hidden or visible. Both of the options will change the default for all other screen sizes and print. In other words, hidden-sm will make the content hidden for small screens, but visible on all others; visible-sm will make the content visible on small screens, but visible on all others.
One thing to note about visible-printvisible-print, while perfect for a demonstration, as you saw in the video, does have a couple of issues. First, it is deprecated, meaning it will eventually be removed from Boostrap. Second, while it will be visible only when printing, all other content currently being displayed on the page will also be visible. If you want something to be hidden when printing, use hidden-print.

visible summary

ClassExtra smallSmallMediumLarge
visible-xsDisplayed   
visible-sm Displayed  
visible-md  Displayed 
visible-lg   Displayed

hidden summary

ClassExtra smallSmallMediumLarge
hidden-xsDisplayedDisplayedDisplayed 
hidden-sm DisplayedDisplayedDisplayed
hidden-md DisplayedDisplayedDisplayed
hidden-lg DisplayedDisplayedDisplayed

No comments:

Post a Comment