Robert "Bob" Smith
Bob originally created this guide. The goal was to assist librarians in utilizing Bootstrap within LibGuides.
As of Feb. 2nd, 2024, Bob has left the employ of West Texas A&M University.
Bootstrap within LibGuides provides means for making images responsive, formatting the image, and hiding content based on screen size.
You can make the images responsive to the size of the containing element by adding class="img-responsive"
to your <img>
tag.
Bootstrap provides three classes that applies shapes to images.
To apply rounded edges, add the class img-rounded
to your <img>
tag.
To make an image in a shape of a circle, add the class img-circle
to your <img>
tag.
To apply thumbnail formating to your image, add the class img-thumbnail
to your <img>
tag.
As covered in "The Grid" section, elements are formatted by screen size, included in this is the ability to hide content based on the screen size. Hiding images based on screen size is a best practice for limiting bandwidth and removing unnecessary, decorative images from your LibGuide. The following are the classes you can add to any element to hide content based on screen size:
Screen Size | Classes | Example |
---|---|---|
xs | .hidden-xs |
Image is now hidden. |
sm | .hidden-sm |
Image is now hidden. |
md | .hidden-md |
Image is now hidden. |
lg | .hidden-lg |
Image is now hidden. |
Note: The Image is now hidden labels are only visibile on certain screen sizes, using the classes .visibile-*
.
For further information and options concerning images, please see the following websites: