Learn 'Mobile First' Web Design Using Bootstrap 3 by Rahul A. Sakla - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Chapter 17 Advanced Classes

 

Media Object

Abstract object styles for building various types of components tlike blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.

Default Media

The default media displays a media object timages, video, audio) to the left or right of a content block.

 

img365.png

img366.png

img367.png

 

The classes .pull-left and .pull-right also exist and were previously used as part of the media component, but are deprecated for that use as of v3.3.0. They are approximately equivalent to .media-left and .media-right, except that .media-right should be placed after the .media-body in the html.

Media Alignment

The images or other media can be aligned top, middle, or bottom. The default is top aligned.

img368.png

img369.png

img370.png

img371.png

img372.png

 

Media List

With a bit of extra markup, you can use media inside list tuseful for comment threads or articles lists).

 

img373.png

img374.png

img375.png

img376.png

 

List Group

List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.

Defualt List Group

The most basic list group is simply an unordered list with list items, and the proper classes. Build upon it with the options that follow, or your own CSS as needed.

 

img377.png

img378.png

img379.png

 

Badges

Add the badges component to any list group item and it will automatically be positioned on the right.

img380.png

img381.png

 

Linked Items

Linkify list group items by using anchor tags instead of list items tthat also means a parent <div> instead of an <ul>). No need for individual parents around each element.

img382.png

img383.png

img384.png

 

Disabled Item

Add .disabled to a .list-group-item to gray it out to appear disabled.

 

img385.png

 

img386.png

img387.png

 

Contextual Classes

Use contextual classes to style list items, default or linked. Also includes .active state.

img388.png

img389.png

img390.png

 

Custom Content

Add nearly any HTML within, even for linked list groups like the one below.

 

img391.png

img392.png

 

Panels

While not always necessary, sometimes you need to put your DOM in a box. For those situations, try the panel component.

Basic Example

By default, all the .panel does is apply some basic border and padding to contain some content.

 

img393.png

img394.png

 

Panel With Heading

Easily add a heading container to your panel with .panel-heading. You may also include any <h1>-<h6> with a .panel-title class to add a pre-styled heading.

For proper link coloring, be sure to place links in headings within .panel-title.

img395.png

 

img396.png

img397.png

img398.png

 

Panel With Footer

Wrap buttons or secondary text in .panel-footer. Note that panel footers do not inherit colors and borders when using contextual variations as they are not meant to be in the foreground.

 

img399.png

img400.png

 

Contextual Alternatives

img401.png

Like other components, easily make a panel more meaningful to a particular context by adding any of

You may also like...