Category: 2. Content

https://img.pikbest.com/origin/09/29/68/982pIkbEsTgr7.png!sw800

  • Figures

    This chapter discusses about the figure component of Bootstrap. Consider utilizing the <figure> element whenever you have a need to exhibit content, such as an image that may be accompanied by an optional caption.

    • <figure> element is used to markup a photo or an image in a document and <figcaption> is used to define a caption to that photo.
    • The .figure class is used to create a responsive container for images, videos, or other media objects.
    • It provides a way to wrap media content along with optional captions and other related elements.
    • The classes .figure, .figure-img and .figure-caption provide baseline styles for the <figure> and <figcaption>.
    • Use .img-fluid class to your <img>, in order to make it responsive; as the images in figures have no explicit size.

    Let us see an example of .figure class

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html><head><title>Bootstrap - Figures</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><h4>Figures</h4><br><figure class="figure"><img src="/bootstrap/images/scenery.jpg" class="figure-img img-fluid rounded" alt="Image in Figure"><figcaption class="figure-caption">A caption for the responsive image.</figcaption></figure></body></html>

    The alignment of the caption can be changed using the text utilities, such as .text-start, .text-center or .text-end.

    Let us see an example for changing the alignment of caption

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html><head><title>Bootstrap - Figures</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><h4>Figure caption alignment</h4><br><figure class="figure"><img src="/bootstrap/images/tutimg.png" class="figure-img img-fluid rounded" alt="Image in Figure"><figcaption class="figure-caption text-center">Responsive image</figcaption></figure></body></html>

    Print Page

  • Tables

    This chapter will discuss about bootstrap tables and the classes to create table. Tables is used to organize data in the form of rows and columns. Tables allow you to group huge amounts of data and present them clearly and in an orderly manner. Some table items supported by Bootstraps are listed below.

    Sr.No.Tag & Description
    1<table>Wrapping element for displaying data in a tabular format
    2<thead>Container element for table header rows (<tr>) to label table columns.
    3<tbody>Container element for table rows (<tr>) in the body of the table.
    4<tr>Container element for a set of table cells (<td> or <th>) that appears on a single row.
    5<td>Default table cell.
    6<th>Special table cell for column (or row, depending on scope and placement) labels. Must be used within a <thead>
    7<caption>Defines a table caption

    Simple table

    If you want a basic table style with just a little light padding and horizontal dividers, add the .table class at table, as shown in the example below.

    Example

    You can edit and try running this code using Edit & Run option.

    <DOCTYPE html ><html lang="en"><head ><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script><title >Bootstrap - Table</title ></head ><body ><table class="table" ><thead ><tr ><th scope="col" >Sr.No.</th ><th scope="col" >Name</th ><th scope="col" >Role</th ><th scope="col" >Salary</th ></tr ></thead ><tbody ><tr ><th scope="row" >1</th ><td >Jhon</td ><td >Software Developer</td ><td >40000</td ></tr ><tr ><th scope="row" >2</th ><td >David</td ><td >Tester</td ><td >50000</td ></tr ><tr ><th scope="row" >3</th ><td >Mary</td ><td >Data Analyst</td ><td >35000</td ></tr ></tbody ></table ></body ></html >

    Variants

    The contextual classes allow you to change the background color of your table rows or individual cells. Add classes .table-active.table-success.table-danger.table-warning class to Highlight a table row or cell, as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Table</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><table class="table"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr class="table-default"><th scope="row">1</th><td>Oliver</td><td>Full satck developer</td><td>40000</td></tr><tr class="table-primary"><th scope="row">2</th><td>Jhon</td><td>Software Developer</td><td>43000</td></tr><tr class="table-secondary"><th scope="row">3</th><td>David</td><td>Tester</td><td>60000</td></tr><tr class="table-info"><th scope="row">4</th><td>Sam</td><td>Software Developer</td><td>35000</td></tr><tr class="table-danger"><th scope="row">5</th><td>Mary</td><td>Data Analyst</td><td>36000</td></tr><tr class="table-success"><th scope="row">6</th><td>James</td><td>Tester</td><td>47000</td></tr><tr class="table-active"><th scope="row">7</th><td>Mary</td><td>HR</td><td>90000</td></tr><tr class="table-light"><th scope="row">8</th><td>Noah</td><td>Data Analyst</td><td>50000</td></tr><tr class="table-warning"><th scope="row">9</th><td>Lucas</td><td>Software Developer</td><td>52000</td></tr><tr class="table-dark"><th scope="row">10</th><td>Almand</td><td>Software Developer</td><td>73000</td></tr></tbody></table></body></html>

    Accented tables

    Striped rows

    To get zebra-striping on the rows add .table-striped class in the .tbody as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table table-striped"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Striped columns

    To get zebra-striping on the columns add .table-striped-columns class in the .tbody as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table table-striped-columns"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-dark and .table-striped to get the dark color zebra-striping on the table.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table table-dark  table-striped"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-dark and .table-striped-columns to get the dark color zebra-striping columns.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table table-dark  table-striped-columns"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-success and .table-striped to get the light green color zebra-striping on the table.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table  table-success table-striped"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-success and .table-striped-columns to get the light green color zebra-striping columns on the table.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table  table-success table-striped-columns"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Hoverable rows

    Add the .table-hover class to get the hover effect on table rows as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script><title>Bootstrap - Table</title></head><body><table class="table table-hover  table-secondary"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-hover and .table-dark to get the dark color hover effect on table rows.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table  table-dark table-hover"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Add the classes .table-hover and .table-striped to get the hover effect with zebra-striping on the table.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table  table-hover  table-striped"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Active table

    Add .table-active class to highlight the row or cell of the table.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr class="table-active"><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr class="table-active"><th scope="row">3</th><td >mery</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Bordered table

    To get boundaries around each item and rounded corners around the whole table add .table-bordered class in the .tbody as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script><title>Bootstrap - Table</title></head><body><table class="table table-bordered  border-primary"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Tables without borders

    To get the table without borders add .table-borderless class in the .tbody as shown in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table table-borderless"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Small tables

    To make table more compact by cutting all cell padding in half by adding .table-sm class to any .table, as seen in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script><title>Bootstrap - Table</title></head><body><table class="table table-sm"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Table group dividers

    To make table border thicker and darker between table groups .thead, .tbody and .tfoot add a .table-sm class, as seen in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" ></script><title>Bootstrap - Table</title></head><body><table class="table"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody class="table-group-divider"><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mary</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Vertical alignment

    The cells of the <thead> table are always vertically aligned to the bottom. The cells in the <tbody> table inherit their alignment from <table> and are aligned to the top by default. Use the vertical alignment classes to re-align as required

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Tables</title></head><body><div class="table-responsive"><table class="table align-middle"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr class="align-bottom"><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td>Mery</td><td class="align-top">Data Analyst</td><td>35000</td></tr></tbody></table></div></body></html>

    Responsive table

    Responsive tables enable horizontal scrolling of the table. Wrapping class .table with .table-responsive makes a table responsive across different view ports. Add a maximum breakpoint to a responsive table by using .table-responsive{-sm|-md|-lg|-xl|-xxl}. Following table depicts the screensize and respective Bootstrap table class:

    ClassScreen width
    .table-responsive-sm< 576px
    .table-responsive-md< 768px
    .table-responsive-lg< 992px
    .table-responsive-xl< 1200px
    .table-responsive-xxl< 1400px

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><div class="table-responsive"><table class="table table-bordered"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Age</th><th scope="col">Blood Group</th><th scope="col">gender</th><th scope="col">Address</th><th scope="col">Married</th><th scope="col">Education</th><th scope="col">AdharCard Number</th><th scope="col">Pan Number</th><th scope="col">City</th><th scope="col">Country</th><th scope="col">Salary</th><th scope="col">status</th><th scope="col">status</th><th scope="col">status</th><th scope="col">status</th></tr></thead><tbody><tr><td></td><td>Jhon</td><td>Software Developer</td><td>32</td><td>A+</td><td>Male</td><td>Pune,Maharashtra.</td><td>Yes</td><td>B.E(Computer Science)</td><td>0101010101010101</td><td>2020200202020202</td><td>Pune</td><td>India</td><td>40000</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td></tr></tbody></table></div></body></html>

    Nesting

    Table nesting is used to create a table inside of a table, as seen in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" ><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table"><thead class="table"><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><td colspan="4"><table class="table mb-0  table-striped"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Almand</td><td>Software Developer</td><td>60000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>35000</td></tr><tr><th scope="row">3</th><td>Sam</td><td>Data Analyst</td><td>40000</td></tr></tbody></table></td></tr><tr><th scope="row">2</th><td>Mona</td><td>Data Analyst</td><td>50000</td></tr><tr><th scope="row">3</th><td>Oliver</td><td>Tester</td><td>45000</td></tr></tbody></table></body></html>

    Anatomy

    Table head

    Add classes .table-secondary to make table head gray color, as seen in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table"><thead class="table-secondary"><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td >mery</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

    Table foot

    The .tfoot class add footer at the end of the table, as seen in the below example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table"><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td >mery</td><td>Data Analyst</td><td>35000</td></tr></tbody><tfoot><tr><th scope="row">footer</th><td >footer</td><td>footer</td><td>footer</td></tr></tfoot></table></body></html>

    Caption

    A <caption> functions use to give a heading for a table., as seen in the below example

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script><title>Bootstrap - Table</title></head><body><table class="table"><caption>List of Employees</caption><thead><tr><th scope="col">Sr.No.</th><th scope="col">Name</th><th scope="col">Role</th><th scope="col">Salary</th></tr></thead><tbody><tr><th scope="row">1</th><td>Jhon</td><td>Software Developer</td><td>40000</td></tr><tr><th scope="row">2</th><td>David</td><td>Tester</td><td>50000</td></tr><tr><th scope="row">3</th><td >mery</td><td>Data Analyst</td><td>35000</td></tr></tbody></table></body></html>

  • Images

    This chapter will discuss various classes provided by Bootstrap, as a support to the images. Images play a vital role in capturing the attention of a visitor on a website. Apart from making the content interesting and engaging, the images help in planning the content strategy of any website.

    Responsive Images

    Images can be made responsive in Bootstrap using the class .img-fluid. This class applies max-width: 100%; and height: auto; to the image so that it scales with the parent width. The responsive images automatically fit as per the size of the screen.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container mt-3 p-2"><h2 class="text-start">Responsive Image</h2><img src="/bootstrap/images/tutimg.png" class="img-fluid" alt="Responsive Image"></div></body></html>

    Image as Thumbnail

    An image to be displayed as a thumbnail with a border and some padding, use the class .img-thumbnail on the image element

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container mt-3 p-2"><h2 class="text-start">Thumbnail Image</h2><img src="/bootstrap/images/scenery.jpg" class="img-thumbnail" alt="Thumbnail Image"></div></body></html>

    Image with Rounded Corners

    An image to be displayed with rounded corners, use the class .rounded on the image element

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container mt-3 p-2"><h2 class="text-start">Image with rounded corners</h2><img src="/bootstrap/images/scenery2.jpg" class="rounded" alt="Image with rounded corners"></div></body></html>

    Alignment of Images

    The images that are added to the webpage can be aligned as per our choice and that can be left, right or centred. In order to place an image:

    • to the left, use the class .float-start

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container mt-3 p-2"><h2 class="text-start">Image aligned to left</h2><img src="/bootstrap/images/scenery3.jpg" class="float-start" alt="Left aligned Image"></div></body></html>
    • to the right use the class .float-end

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container mt-3 p-2"><h2 class="text-center">Image aligned to right</h2><img src="/bootstrap/images/tutimg.png" class="float-end" alt="Right aligned Image"></div></body></html>
    • to the center, use the utility classes .mx-auto (margin:auto) and .d-block (display:block)

    Example

    You can edit and try running this code using theEdit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><h2 class="text-center">Image aligned to centre</h2><img src="/bootstrap/images/profile.jpg" width="500" height="500" class="mx-auto d-block" alt="Centre aligned Image"></div></body></html>

    Picture

    When multiple <source> elements are used for a specific image <img> element under a <picture> element/tag, then we must add the .img-* classes to the <img> element and not to the <picture> element/tag.

    Example

    You can edit and try running this code using theEdit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Images</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h1>Use of Picture tag</h1><picture><img class="img-fluid img-thumbnail" alt="alt text for all sources" src="/bootstrap/images/tutimg.png"></picture></body></html>
  • Typography

    This chapter, will discuss about the various typography related features provided by Bootstrap. Typography is the art of making the written matter look legible, attractive and appealing when displayed.

    Bootstrap Default / Global Settings

    The latest version of Bootstrap sets the default settings for display, typography and link styles. Following are some of the default settings:

    • Bootstrap sets a default font-size of 1rem, 16px by default.
    • Bootstrap sets the line-height as 1.5
    • For optimum text rendering on every device and OS through font-family, use the “Native Font Stack”.
    • The $body-bg variable should be used to set a background-color on the <body> tag, where #fff is by default.
    • The global link color can be set using the variable $link-color and apply link underlines only on :hover.
    • To apply the typographic base to the <body> tag, use the attributes such as $font-family-base, $font-size-base, and $line-height-base.

    One must set the $font-size-base in rem. The global variables are defined in _variables.scss and the styles within _reboot.scss.

    Headings

    The HTML heading tags i.e. <h1> to <h6> are styled in bootstrap in the following way.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Headings </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h1>Heading 1 - h1</h1><h2>Heading 2 - h2</h2><h3>Heading 3 - h3</h3><h4>Heading 4 - h4</h4><h5>Heading 5 - h5</h5><h6>Heading 6 - h6</h6></body></html>

    The classes .h1 to .h6 are also available in bootstrap, to match the font styling of a heading without using the associated HTML element.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Headings Classes </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p class="h1">Class h1 - Heading 1</p><p class="h2">Class h2 - Heading 2</p><p class="h3">Class h3 - Heading 3</p><p class="h4">Class h4 - Heading 4</p><p class="h5">Class h5 - Heading 5</p><p class="h6">Class h6 - Heading 6</p></body></html>

    Customizing Headings

    The utility classes provided by bootstrap can be used to customize the headings.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Customizing Headings </title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p>This is an example to show the customized heading.</p><h4>
    
        Here the text will
      &lt;small class="text-muted"&gt; be customized through this class.&lt;/small&gt;&lt;/h4&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Display Headings

    When the headings are to be displayed in a larger and opinionated style, then the display heading classes can be used

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Display Headings </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p class="display-1">Display 1 - Heading 1</p><p class="display-2">Display 2 - Heading 2</p><p class="display-3">Display 3 - Heading 3</p><p class="display-4">Display 4 - Heading 4</p><p class="display-5">Display 5 - Heading 5</p><p class="display-6">Display 6 - Heading 6</p></body></html>

    Lead

    The class .lead makes the paragraph stand out. It gives a larger font size, lighter weight, and a taller line height to the text in a paragraph.https://www.tutorialspoint.com/bootstrap/examples/typography_lead.php

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Lead </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p class="lead">
    
       The class lead will make the paragraph look different from the regular paragraph. It looks stand-out.
     &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Abbreviations

    The <abbr> element of HTML is styled by bootstrap where the fullform of the abbreviations and the acronyms is shown on hover and the text is displayed with a light dotted line at the bottom of the text.

    Use .initialism class to an abbreviation, in order to get a slightly smaller font size.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Abbreviations </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p><abbr title="Indian Space Research Organisation">ISRO</abbr></p><p><abbr title="World Health Organisation" class="initialism">WHO</abbr></p></body></html>

    Blockquote

    When a block of content needs to be added in a document as a quote, class .blockquote is used around the <blockquote> html element.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Blockquote </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Example for blockquote</h4><p>Refer the quote given below.</p><blockquote class="blockquote"><p>An ounce of patience is worth more than a tonne of preaching</p></blockquote></body></html>

    Naming a Source

    Bootstrap provides a class .blockquote-footer inside the <footer> element for identifying the source. <cite> tag is used to wrap the name of the source work.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Naming Source </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Example for Naming a Source</h4><p>Refer the quote given below.</p><blockquote class="blockquote"><p>An ounce of patience is worth more than a tonne of preaching</p><footer class="blockquote-footer">Written by someone <cite title="Very famous">Very famous</cite></footer></blockquote></body></html>

    Alignment

    Bootstrap provides classes to change the alignment of the blockquote, such as .text-center and .text-right.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography - Blockquote Alignment </title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Example for alignment of blockquote</h4><p>Refer the quote given below.</p><blockquote class="blockquote text-center"><p>An ounce of patience is worth more than a tonne of preaching</p><footer class="blockquote-footer">Written by someone <cite title="Very famous">Very famous</cite></footer></blockquote></body></html>

    Inline Text Elements

    Instead of using the common inline HTML5 elements, bootstrap provides the classes that can be used for styling of the text. Follow some of the examples given below:

    • .mark

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of mark </h4><p>Demonstrating use of mark tag to <mark> highlight </mark>  text.</p><p class="mark">Demonstrating use of mark class to highlight text.</p></body></html>
    • .small

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of small</h4><p>Demonstrating use of <small> tag to make the text look fineprint.</p><p class="small">Demonstrating use of small class to make the text look fineprint.</p></body></html>
    • .text-decoration-underline

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of .text-decoration-underline</h4><p>Demonstrating use of <u> tag to make the text underlined.</p><p class="text-decoration-underline">Demonstrating use of text-decoration-underline class to make the text underlined.</p></body></html>
    • .text-decoration-line-through

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of .text-decoration-line-through</h4><p>Demonstrating use of s tag to treat the text as no longer accurate.</p><p class="text-decoration-line-through">Demonstrating use of text-decoration-line-through class to treat the text as no longer accurate.</p></body></html>
    • <del>

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of <del> element</h4><p><del>Demonstrating use of <del> tag to render the text as deleted.</del></p></body></html>
    • <strong>

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of strong element</h4><p><strong>Demonstrating use of strong tag to render the text as bold.</strong></p></body></html>
    • <em>

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Inline Elements</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of em element</h4><p><em>Demonstrating use of em tag to render the text as italicized.</em></p></body></html>

    Lists

    Unstyled

    The class .list-unstyled removes the default style of list and the left margin on the items of the list. However, this style only applies to the immediate child elements.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Lists</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of .list-unstyled</h4><p>The class .list-unstyled removes the default style of list and the left margin on the items of the list.</p><ul class="list-unstyled"><li>Snacks</li><li>Beverages
    
           &lt;ul class="list"&gt;&lt;li&gt;Cold Beverage&lt;/li&gt;&lt;li&gt;Hot Beverage&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Inline

    Bootstrap provides a combination of two classes, .list-inline and .list-inline-item, that removes a list's bullets and adds some margin or space in between the listed items.

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Lists</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of .list-inline and .list-inline-item</h4><p>The classes <b>.list-inline</b> and <b>.list-inline-item</b> removes a list's bullets and adds a little margin.</p><ul class="list-inline"><li class="list-inline-item">Tea</li><li class="list-inline-item">Coffee</li><li class="list-inline-item">Juice</li></ul></body></html>

    Description List Alignment

    Bootstrap provides predefined classes to be added to the <dl><dt>, and <dd> tags of HTML to align terms and descriptions horizontally. One can optionally add the class .text-truncate to truncate the text with an ellipsis.https://www.tutorialspoint.com/bootstrap/examples/typography_desc_list_alignment.php

    Example

    You can edit and try running this code using the Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap Typography Description List Alignment</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h4>Use of classes for description list alignment</h4><p>The predefined classes of bootstrap help to align terms and description in grid form.</p><dl class="row"><dt class="col-sm-3">Description Lists</dt><dd class="col-sm-9">This tag shows the description of the term</dd><dt class="col-sm-3 text-truncate">The predefined class text-truncate truncates the text and returns the output with ellipsis.</dt><dd class="col-sm-9">This tag shows the truncated text with ellipsis</dd></dl></body></html>

    Responsive Font Sizes

    Responsive font sizes are enabled in bootstrap 5 by default, allowing the text to scale automatically across all the devices and viewport sizes. It is abbreviated as RFS and is capable of rescaling the text with unit values like margin, padding, border-radius, or even box-shadow.

    The RFS automatically calculates the appropriate values as per the dimensions of the browser viewport.

  • Reboot

    This chapter will discuss about Bootstrap reboot. Reboot is used to reset all the styles of a particular element.

    Approach

    Reboot styles HTML elements with opinionated styles using only element selectors. Extra styling is done with classes only. For instance, reboot some <table> styles, then include the classes .table.table-bordered, and more.

    • Replace default ems with rems for scalable component spacing in browsers.
    • Skip margin-top. Vertical margins collapse unexpectedly. However, a margin with single direction is a simpler concept.
    • Block elements should use rems for margins to make scaling across device sizes easier.
    • Use inherit whenever possible and limit font-related properties declarations.

    This enables you to customize in real-time, however you’d like to:

    <body style="--bs-body-color: #333;"><!-- ... --></body>

    Page defaults

    Reboot is used for a elements <HTML> and <body> elements to provide better page-wide defaults. More details are as below.

    • All elments have a global box-sizing, including *::before*::after, to border-box. Padding and borders won’t exceed element’s declared width because of it.
      • If no font-size is set on <HTML>16px is assumed as browser default. Use font-size: 1rem on the <body> for accessible, responsive type-scaling, considering user preferences. Modify $font-size-root variable to override default browser setting.
    • Global styles for <body> include font-familyfont-weightline-height, and color. To avoid font discrepancies, some form elements will inherit this later.
    • <body> background-color is defaulted to #fff for security purposes.

    Native font stack

    • Reboot is used for the Bootstrap uses a native font stack or system font stack for optimum text rendering on every device and OS.
    • These system fonts are designed for modern devices with improved screen rendering, changeable font support and more.
    • Learn more about native font stacks.
    $font-family-sans-serif:
      // Cross-platform generic font family (default user interface font)
      system-ui,
      // Safari for macOS and iOS (San Francisco)
      -apple-system,
      // Windows
      "Segoe UI",
      // Android
      Roboto,
      // older macOS and iOS
      "Helvetica Neue"
      // Linux
      "Noto Sans",
      "Liberation Sans",
      // Basic web fallback
      Arial,
      // Sans serif fallback
      sans-serif,
      // Emoji fonts
      "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
    
    Notes
    • The font stack has emoji fonts, thus the common symbols, dingbat Unicode characters will appear as colorful pictographs. Their appearance varies with the native emoji font of the browser or platform, and remain unaffected by CSS color styles.
    • font-family is applied to the <body> and automatically inherited globally in Bootstrap. Update $font-family-base and recompile the Bootstrap for global font-family change.

    Headings

    Bootstrap Reboot headings are used for removing the default margin that has been provided by HTML header tags which are margin-bottom: .5rem and tightened line-height.

    The –bs-heading-color CSS variable allows you to change the default heading-color.

    HeadingExample
    <h1></h1>h1. Bootstrap heading
    <h2></h2>h2. Bootstrap heading
    <h3></h3>h3. Bootstrap heading
    <h4></h4>h4. Bootstrap heading
    <h5></h5>h5. Bootstrap heading
    <h6></h6>h6. Bootstrap heading

    Paragraphs

    Bootstrap 5 reboot paragraphs are used for removing default margin-top that has been provided by HTML <p> tags and set paragraph margin-bottom: 1rem.https://www.tutorialspoint.com/bootstrap/examples/reboot_paragraph.php

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p>This is the first paragraph.</p><p>This is the second paragraph.</p></body></html>

    Links

    Reboot provides links have default color and underline, and change on :hover but not when a user has :visited. No special :focus styles are given.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p><a href="#">Visit Tutorialspoint..</a></p></body></html>

    As a Bootstrap v5.3.x, link color is set using rgba() and new -rgb CSS variables. This allows easy customization of link color opacity. Link color opacity can be changed using CSS variable –bs-link-opacity as demostrated in the following example.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p><a href="#" style="--bs-link-opacity: .7">Visit Tutorialspoint</a></p></body></html>

    Bootstrap reboot targets placeholder links (those without an href) with more specific selectors. Their color and text-decoration are reset to their default values.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><p><a>Visit Tutorialspoint</a></p></body></html>

    Horizontal rules

    Reboot simplifies <hr> element. The <hr> elements are styled with border-top and opacity: .25 by default, and inherit their border-color from the parent color automatically.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><h2 class="text-center">Horizontal rules</h2><div class="container"><hr><div class="text-primary"><hr></div><hr class="border border-warning border-3 opacity-75"><hr class="border border-info border-4 opacity-100"></div></body></html>

    Lists

    • Bootstrap reboot has removed margin-top and set margin-bottom: 1rem of lists.
    • List elements <ul><ol>, and <dl> have a margin-top removed and set margin-bottom: 1rem.

    Description lists have improved margins for easier styling, clear hierarchy, and spacing <dd>s reset margin-left to 0, and add margin-bottom: .5rem<dt>s are bolded.https://www.tutorialspoint.com/bootstrap/examples/reboot_description_list.php

    Inline Code

    Use <code> to enclose inline code snippets. Escape HTML angle brackets as necessary.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container">
    
      The &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; element should be enclosed within an inline container.
    &lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Code blocks

    Bootstrap 5 Reboot Code blocks are used to put the code inside of <pre> tag. It is recommanded to escape angle brackets in code for proper rendering. <pre> element is reset to remove its margin-top.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><pre><code>Tutorialspoint
    
        This is an example of code block.
        &lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Variables

    Reboot variables are used to reboot the style of <var> tag elements.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><var>a</var><var>x</var> + <var>b</var><var>y</var> = <var>c</var></body></html>

    User input

    Reboot user input <kbd> is used to indicate input that is typically entered via keyboard.

    The text enclosed within the <kbd> tag is typically dispalyed in the browser's default monospace font.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container">
    
        To save the changes, press &lt;kbd&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;s&lt;/kbd&gt;&lt;/kbd&gt;&lt;br&gt;
        To paste the selected item, press &lt;kbd&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;v&lt;/kbd&gt;&lt;/kbd&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Sample output

    The <samp> tag should be used to indicate sample output from a program.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><samp>This text should be considered as an example output generated by a computer program.</samp></div></body></html>

    Tables

    Tables are modified for style <caption>s, border collapse, and consistent text-align. The .table class offers further modifications to borders and padding.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><table><caption>
    
            This is a caption of table to describe the contents.
          &lt;/caption&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Employee Id&lt;/th&gt;&lt;th&gt;Employee Name&lt;/th&gt;&lt;th&gt;Employee Role&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;Jhon&lt;/td&gt;&lt;td&gt;Software Devloper&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;Mayra&lt;/td&gt;&lt;td&gt;Tester&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;Rocky&lt;/td&gt;&lt;td&gt;Data Analyst&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Forms

    Form elements have been simplified for new base styles. The most significant changes are listed below:

    • <fieldset>s can be easily used as wrappers for single inputs or groups of inputs as they don't have borders, padding, or margins.
    • <legend>s have been restyled to be displayed as a heading.
    • To allow for margins, <label>s are set to display: inline-block.
    • Normalise mainly handles the styling of <input>s, <select>s, <textarea>s, and <button>s, while reboot also removes their margin and sets line-height: inherit.
    • <textarea>s are only vertically resizable to prevent page layout "breaks".
    • <button>s and <input> buttons have cursor: pointer when not disabled.

    Some date inputs are not supported by the latest versions of Safari and Firefox.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><form class="bd-example"><fieldset><legend>Form</legend><p><label for="input">Name</label><input type="text" id="inputName" placeholder="Enter your name..."></p><p><label for="email">Email id</label><input type="email" id="emailId" placeholder="[email protected]"></p><p><label for="tel">Mobile No:</label><input type="tel" id="Mob"></p><p><label for="url">Age</label><input type="number" id="age"></p><p><label for="number">Number</label><input type="number" id="number"></p><p><label for="search">Search Here</label><input type="search" id="searchHere"></p><p><label for="range">Range</label><input type="range" id="rangeExample" min="0" max="10"></p><p><label for="file">Upload file</label><input type="file" id="fileinput"></p><p><label for="select">Languages</label><select id="select"><option value="">select...</option><optgroup label="Group 1"><option value="">HTML</option><option value="">CSS</option><option value="">Bootstrap</option></optgroup><optgroup label="Group 2"><option value="">C</option><option value="">C++</option><option value="">Java</option></optgroup></select></p><p><h6>Selects the languages</h6><label><input type="checkbox" value="">
    
                HTML
            &lt;/label&gt;&lt;br&gt;&lt;label&gt;&lt;input type="checkbox" value=""&gt;
                CSS
            &lt;/label&gt;&lt;br&gt;&lt;label&gt;&lt;input type="checkbox" value=""&gt;
                Javascript
            &lt;/label&gt;&lt;/p&gt;&lt;p&gt;&lt;h6&gt;Select your gender&lt;/h6&gt;&lt;label&gt;&lt;input type="radio" name="firstOption" id="radios1" value="option1" checked&gt;
              Female
            &lt;/label&gt;&lt;br&gt;&lt;label&gt;&lt;input type="radio" name="secondOption" id="radios2" value="option2"&gt;
              Male
            &lt;/label&gt;&lt;br&gt;&lt;label&gt;&lt;input type="radio" name="thirdOption" id="radios3" value="option3" disabled&gt;
                Others
            &lt;/label&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="textarea"&gt;Feedback&lt;/label&gt;&lt;textarea id="feedbackTextarea" rows="4"&gt;&lt;/textarea&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="date"&gt;Birth date&lt;/label&gt;&lt;input type="date" id="birthDate"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="time"&gt;Time&lt;/label&gt;&lt;input type="time" id="timeInput"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="password"&gt;Enter Password&lt;/label&gt;&lt;input type="password" id="password"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="datetime-local"&gt;Local Datetime&lt;/label&gt;&lt;input type="datetime-local" id="localDatetime"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="week"&gt;Select week&lt;/label&gt;&lt;input type="week" id="weekInput"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="month"&gt;Select month&lt;/label&gt;&lt;input type="month" id="monthInput"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="color"&gt;Selet color&lt;/label&gt;&lt;input type="color" id="selectColor"&gt;&lt;/p&gt;&lt;p&gt;&lt;label for="output"&gt;Output: &lt;/label&gt;&lt;output name="result" id="output"&gt;Tutorialspoint&lt;/output&gt;&lt;/p&gt;&lt;p&gt;&lt;label&gt;Buttons&lt;/label&gt;&lt;button type="submit"&gt;Submit&lt;/button&gt;&lt;input type="reset" value="Reset"&gt;&lt;input type="button" value="Button"&gt;&lt;/p&gt;&lt;p&gt;&lt;label&gt;Disabled Buttons&lt;/label&gt;&lt;button type="submit" disabled&gt;Submit&lt;/button&gt;&lt;input type="reset" value="Reset" disabled&gt;&lt;input type="button" value="Button" disabled&gt;&lt;/p&gt;&lt;/fieldset&gt;&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Pointers on buttons

    • Reboot provides a role="button" that changes the cursor to a pointer. Use this attribute to indicate interactive elements.
    • Not necessary for <button> elements, as they have their own cursor change.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><span role="button" tabindex="0">Non-button element</span></div></body></html>

    Misc elements

    Address

    • Reboot address element <address> is used to change the font-style from italic to normal text.
    • It inherits line height and margin-bottom is set to 1rem.
    • Preserve formatting by ending lines with <br>.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><address><strong>ABC Corporation</strong><br>
    
            505 sansui street,&lt;br&gt;
            Eillis, CA 0178&lt;br&gt;&lt;abbr title="Phone"&gt;P:&lt;/abbr&gt; (212) 357-0194
          &lt;/address&gt;&lt;address&gt;&lt;a href="mailto:[email protected]"&gt;[email protected]&lt;/a&gt;&lt;/address&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

    Blockquote

    Blockquotes default margin is 1em 40px, which is changed to 0 0 1rem for consistency with other elements. These are used when we want to quote content from other sources.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><blockquote class="blockquote"><p>Blockquote removes default margin of HTML blockquote tag element.</p></blockquote><p>Someone well-known in <cite title="Source Title">Source Title</cite>.</p></div></body></html>

    Inline elements

    Reboot inline elements are used to put some elements abbreviations or short forms of an element that receive basic styling to make it different than other text.

    Basic styling is applied to the <abbr> element to stand out from the paragraph text.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body>
    
      The &lt;abbr title="Cascading Style Sheet"&gt;CSS&lt;/abbr&gt; is a style sheet language.
    </body></html>

    Summary

    Text elements can be made interactive to show summary. The default value of the cursor on it is text. So it is reset to the pointer to tell that the particular element is interactive and the user can click on it.

    Example

    You can edit and try running this code using Edit & Run option.

    <!DOCTYPE html><html lang="en"><head><title>Bootstrap - Reboot</title><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script></head><body><div class="container"><details><summary>Bootstrap Colors</summary><p>Bootstrap colors used to give the colors to the text or the background.</p></details><details open><summary>Bootstrap Dropdown</summary><p>Dropdown menus are toggleable, contextual menus that can be enabled to show links in a list format.</p></details></div></body></html>

    HTML5 [hidden] attribute

    • The golbal attribute [hidden] in HTML5 has the default styling of display: none.
    • To improve this default (display:none) reboot helps prevents its display from getting accidentally overridden by setting [hidden] {display: none !important;}.
    <input type="text" hidden>

    To merely toggle the visibility of an element, meaning its display is not modified and the element can still affect the flow of document, use .invisible class instead