We cover the following 'skills' below, Containers, Grid System, Tables, Jumbotron, Nav | Navbars, and Utilities. Wantedt to share how to place content on a webpage, especially if you've not been exposed to HTML, HTML/CSS and how text/media is formed on the page. We will continue to modify the following sections.
Moving on, building on our container learnings, tables, form elements and content wrappers... How do we style content text and add texture? We will briefly cover text, title text, color and more. The Bootstrap framework is built with the following default settings:
Defaults
Typography
<h1>
- Title Text: h1 - h6 or sizes 1 - 6.display-1
- Display Text: display-1 - display-4 or sizes 1 - 4<small>
- Secondary Text<mark>
- Highleted/Marked Text<abbr>
- Abbreviation text<blockquote>
- Quoted text<dl>
- List Title Strong Weight<code>
- Code text, used throughout the site<kbd>
- Keyboard Actions<pre>
- Separated contextual code or multi-lined code examples. Those are shared throughout the site.Included in the paragraph below, we have 3 examples, mark text, abbreviations and blockquotes. Here we cover mark text or highlighted text, and an abbreviation for NOAA - The National Oceanic and Atmospheric Administration.
"The following paragraph text might be fairly short. However, we wanted to share a blockquote example including both the paragraph and footer text of the blockquote".
Next, we cover two additional class types, code and kbd. We start with another typographical example for 'code', keyboard actions and pre (code examples) div
, container
, and container.lg
. Keyboard actions, example for Windows or Linux - ctrl + a for select all, ctrtl + s for save. Those of you using Macos, ⌘ + a or ⌘ + s. Finally, <pre> included below in the code snippet section for Typography.
Code Snippet - Custom Basics, Defaults
<div class='example border p-5'>
<div class='container-fluid'>
<h1>Title Text </h1>
<hr>
<h1 class='display-4'>H1 - Display-4 Class Title Text</h1>
<hr>
<h1>H1 Title Text<small> - Secondary Title Text and supporting text</small></h1>
<hr>
<p>Included in the paragraph below, we have 3 examples, mark text, abbreviations and blockquotes. Here we cover <mark>mark text or highlighted text</mark>, and an abbreviation for <strong><abbr title='The National Oceanic and Atmospheric Administration'>NOAA</abbr></strong> - The National Oceanic and Atmospheric Administration.</p>
<blockquote>
<p>'The following paragraph text might be fairly short. However, we wanted to share a blockquote example including both the paragraph and footer text of the blockquote'.</p>
Pargraph on colors used in context and those defined with the Bootstrap framework or default text colors/backgrounds. *Although we are only providing four examples below, all classes are provided over on our 'Reference' section for additional classes and uses in your Bootstrap'n journey. An abbreviated section on colors, adding text color values/hues, opacity and percentages. Continuing the typography discussion above, we can push the typography classes a bit further, including body text, button classes and the concept of 'expression' through color.
Typography Color
.text-primary
- Primary, Blue Text.text-success
- Success text, may be used for form success.text-info
- Message text, more information.text-warning
- Warning Text, used for warning messages.text-danger
- Danger, used for errors or incomplete transactions or form issues.Typography Backgrond Colors
.bg-primary
- ditto .bg-success
- ditto .bg-info
- ditto .bg-warning
- ditto .bg-danger
- ditto Additional Colors, Opacity and Shades
.text-muted
- Muted color palette.text-white
- Text white, handy when using background colors.text-black
- Text white, handy when using background colors.text-white-50
- Text white, 50% opacity.text-black-50
- Text black, 50% opacity .text-dark
- Handy when adding text to light or subtle background shades, gradients or images.The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
Code Snippet - Basics and Advanced Colors, Background Colors
<div class='example border p-5'>
<div class='container-fluid'>
<p class='text-primary'>pThe quick brown fox jumps over the lazy dog</p>
<p class='text-secondary'>The quick brown fox jumps over the lazy dog</p>
<p class='text-dark'>The quick brown fox jumps over the lazy dog</p>
<p class='text-success'>The quick brown fox jumps over the lazy dog</p>
<p class='text-info'>The quick brown fox jumps over the lazy dog</p>
<p class='text-warning'>The quick brown fox jumps over the lazy dog</p>
<p class='text-danger'>The quick brown fox jumps over the lazy dog</p>
</div>
</div>
Ok, might be a good time to tie in alerts, color and text predefined in the Bootstrap Framework. Although you have the ability to change and/or append or alter css styles to fit your website needs. You can use the predefined classes to stlye important messaging for your users using the same color classes above.
.alert
- Spacing, padding for alert messages.alert-success
- Styled for a succesful message.alert-danger
- Alert the user that some action has resulted in a failure or an adverse result to the input or system process. .alert-link
- An alert containing a link to perform some action in order to proceed. Alert links might contain an "X" or "Close" for example. When a user is presented with a Modal Window, an "X" or close button might be use so that a user might return to the main or primary experience..alert-success fade show
- Finally, timing or slowing down time might improve a users experience, effectively drawing attention to such alert message, alert message or action.Code Snippet - Alerts
<div class='example border p-5'>
<div class='container-fluid'>
<div class='alert alert-success alertText p-3'>
<i class='fas fa-check logo4'></i>
<strong> Success!</strong> Steam® Services have been brought back online. Please proceed to the next page.</div>
<hr>
<div class='alert alert-warning alertText p-3'>
<i class='fas fa-exclamation-triangle logo4'></i>
<strong>Warning!</strong> Low Cheetos® meter, extremely low!
Need More? Choose <a href='#' class='alert-link' title='Cheetos®'>SnackPax+</a> - Purchase Cheetos® and Cheetos® ~20 mins <a href='#' class='alert-link' title='Cheetos®'>buy now!</a>
</div>
<hr>
</div>
</div>
We cover sorting 'pages' by alpha-numerical values, breadcrumbs (identifying direction and location within a site). Also, covering directional element used in various blog treatments and archival pages. Pagination and breadcrumbs are not always used, however if you would like to include a quick and easy way to imprement pagination your site... your in the right spot. We will cover the basic pagination and breadcrumb implementations below. Covering alignment, sizing and action another time. We've covered action and sizing above in buttons and button grouping section. Alignment is covered elsewhere, while skipping floats, absolute positioned elements and clear.
.pagination
- Pagination draped over a UL (Unordered List).page-item & .page-link
- Links within the unordered list.breadcrumb
- Breadcrumb trail... .breadcrumb-item & .page-link
- links down through navigation funnelCode Snippet - Pagination and Breadcrumbs
<div class='example border p-5'>
<div class='container-fluid'>
<ul class='pagination'>
<li class='page-item'><a class='page-link' href='#'>< Previous</a></li>
<li class='page-item'><a class='page-link' href='#'>1</a></li>
<li class='page-item active'><a class='page-link' href='#'>2</a></li>
<li class='page-item'><a class='page-link' href='#'>3</a></li>
<li class='page-item'><a class='page-link' href='#'>Next ></a></li>
</ul>
</div>
</div>
Images... finally something to spruce up the site... bring life to the textutal elements, colors and structure. Now we introduce images to the mix. We'll cover most, leaving alignement to another topic as the float attribute is used to move images left, center and right. Cutting through the classes, responsive images is the main focus as Bootstrap is mobile first, scaling to the tablets and desktop devices with ease.
.rounded
- Self-contained image, rectangular with rounded corners.rounded-circle
- Self-contained image, rounded to a circle.img-thumbnail
- Self-contained image, thumbnail space and border.mx-auto d-block
- Self-contained image, auto grow to given width.img-fluid
- Self-contained image, fluid image based on screenCode Snippet - Images
<div class='example border p-5'>
<div class='container-fluid'>
<div class='row d-flex justify-content-center'>
</div>
</div>
Need more explaination, add a tooltip with a mouse visual queue for the user. Quickly and easily deploy tooltip 'popup box' providing more information upon user action. This is one of the first reference we use to call another programming lanugage, using the data tag/attribute to provide the expected experience. The script is required inorder to create/interact with the tooltip method. Toggletip might be used for the following: define the total number of followers a users might have as connections or define number of followers 'currently' online.
Tooltip Code
data-toggle="tooltip" title="(Include Text)"
- include the following data-toggle JQuery snippet and title content to implement this code.JQuery Code Snippet - Toggle Method
<script> $(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); </script>
Hover over the 'buy' link and/or the 'tooltip' link below and Voila! Tooltip will show up.
Code Snippet - Tooltips
<div class='example border p-5'>
<div class='container-fluid'>
<script>
$(document).ready(function(){
$('[data-toggle='tooltip']').tooltip();
});
</script>
<h6>Tooltips And More</h6>
<p>Hover over the 'buy' link and/or the 'tooltip' link below and Voila! Tooltip will show up.</p>
<ul>
<li>Hey, you... Interested in a new car? Find out how to <a href='#' data-toggle='tooltip' title='Hooray! A New Car! Try CarWarehouse Today'>buy</a> that new car!</li>
<li>Need A Car? <a href='#' data-toggle='tooltip' title='Hooray! A New Car! Try Car Warehouse Today'>Find Yourself A New Car Today!</a> <small>Look for a new car today!</small></li>
</ul>
<button type='button' data-toggle='tooltip' class='btn btn-outline-secondary' title='Tooltip 2, Here is another example of a tooltip'><i class='fas fa-user'></i> Tooltip</button>
</div>
</div>
In the future we may move Popovers to share space with tooltips. However for now, although similar both are similar from a UX perspective. A user takes some action by clicking on a link, JQuery does some quick wizardry and theres a popover further defining the element selected. So, the example would also include a small JQeury code snippet to create this user interaction.
Popover Code
data-content="popover" title="(Include Text)"
- JQuery Snippet - Popover Method
<script> $(document).ready(function(){ $('[data-toggle="popover"]').tooltip(); }); </script>
Another interaction example using popover. Check out the popover interaction. Hey, you...
Code Snippet - Popover
<div class='example border p-5'>
<div class='container-fluid'>
<script>
$(document).ready(function(){
$('[data-toggle='popover']').popover();
});
</script>
<h6>Popover Link and Text</h6>
<p id='popover2'>Another interaction example using <a href='#popover2' data-toggle='popover' title='Popover Title' data-content='Popover hover text, short paragraph on popover text.'>popover</a>. Check out the popover interaction. Hey, you...</p>
</div>
</div>
Although Bootstrap Version 4 no longer uses the "Glypicons" icon library... We suggest popping over to Font Awesome.com for the latest iconography libraries. Or just simply include the Font Awesome libray link like the one shared here: borg2borg's Font Awesome Library. Margins, alignement, sizing styles still apply, we will cover this more in detail in a few short weeks in the reference section. More to come.
In the meantime, what to useFont Awesome libraries and more? Simply signup, no cost as there is a free-to-premium model used for additional libraries, include files and such.
.fas
- Call Icon class, fas.fas fa-envelope
- envelope class.fab
- Brands, call icon class.fab fa-pinterest
- TikTok classCode Snippet - Icons
<div class='example border p-5'>
<div class='container-fluid'>
<div class='row'>
<div class='col-sm-12'>
<div class='img-fluid'><i class='fas fa-envelope'></i> - fa-envelope</div>
<div class='img-fluid'><i class='fas fa-phone'></i> - fa-phone</div>>
<div class='img-fluid'><i class='fas fa-globe'></i> - fa-globe</div>
</div>
</div>
</div>
</div>
Need Help? How might we help? Connect with us, reach out via email, phone or contact form