Bird
Raised Fist0
Bootsrapmarkup~10 mins

Display headings in Bootsrap - Browser Rendering Trace

Choose your learning style10 modes available
Render Flow - Display headings
[Read <h1>] -> [Create H1 node] -> [Apply Bootstrap heading styles] -> [Render font size and weight] -> [Paint text on screen]
The browser reads the heading tag, creates the element, applies Bootstrap's heading styles which set font size and weight, then paints the styled text on the screen.
Render Steps - 4 Steps
Code Added:<h1 class="display-1">Display 1</h1>
Before
[ ]
(empty page)
→
After
[Display 1]
(very large text, boldness light)
Adding the h1 with display-1 class shows very large text because Bootstrap sets font-size to 6rem and font-weight to 300.
🔧 Browser Action:Creates H1 element, applies CSS styles, triggers layout and paint
Code Sample
This code shows four headings with Bootstrap display classes that make the text very large and light in weight.
Bootsrap
<h1 class="display-1">Display 1</h1>
<h2 class="display-2">Display 2</h2>
<h3 class="display-3">Display 3</h3>
<h4 class="display-4">Display 4</h4>
Bootsrap
.display-1 { font-size: 6rem; font-weight: 300; }
.display-2 { font-size: 5rem; font-weight: 300; }
.display-3 { font-size: 4rem; font-weight: 300; }
.display-4 { font-size: 3rem; font-weight: 300; }
Render Quiz - 3 Questions
Test your understanding
After applying step 1, what is the font size and weight of the heading?
A6rem font size, font-weight 300 (light)
B2rem font size, font-weight 700 (bold)
C4rem font size, font-weight 400 (normal)
D1rem font size, font-weight 300 (light)
Common Confusions - 3 Topics
Why does the text look so light and not bold?
Bootstrap display classes set font-weight to 300, which is lighter than normal bold. This is intentional for a modern look.
💡 Display headings use light font weight by default, unlike normal headings.
Why is the font size so huge compared to normal headings?
Display classes use very large font sizes (3rem to 6rem) to create eye-catching titles, bigger than default heading sizes.
💡 Display classes scale font size up dramatically for emphasis.
What happens if I remove the display class but keep the h1 tag?
The heading will use the browser's default h1 size and weight, which is smaller and bolder than display classes.
💡 Display classes override default heading styles with bigger and lighter text.
Property Reference
ClassFont SizeFont WeightVisual EffectCommon Use
.display-16rem300Very large, light headingMain large titles
.display-25rem300Slightly smaller large headingSecondary large titles
.display-34rem300Medium large headingSubtitles or section titles
.display-43rem300Smaller large headingSmaller section headings
Concept Snapshot
Bootstrap display headings use classes .display-1 to .display-4 They set very large font sizes from 6rem down to 3rem Font weight is light (300) for a modern look Used for big, eye-catching titles Overrides default heading sizes and weights

Practice

(1/5)
1. What is the main purpose of using Bootstrap display heading classes like display-1 to display-4?
easy
A. To hide headings on small screens
B. To change the background color of headings
C. To add animations to headings
D. To make headings larger and more prominent on the page

Solution

  1. Step 1: Understand Bootstrap display classes

    Bootstrap display classes like display-1 to display-4 are used to style headings with bigger and bolder text.
  2. Step 2: Identify the purpose of these classes

    The main goal is to make headings stand out by increasing their size and weight, not to change colors or add animations.
  3. Final Answer:

    To make headings larger and more prominent on the page -> Option D
  4. Quick Check:

    Display classes = bigger, bold headings [OK]
Hint: Display classes make headings big and bold fast [OK]
Common Mistakes:
  • Thinking display classes change colors
  • Confusing display classes with animation classes
  • Assuming display classes hide elements
2. Which of the following is the correct way to apply a Bootstrap display heading class to an <h1> tag?
easy
A. <h1>display-3 Title</h1>
B. <h1 display-3>Title</h1>
C. <h1 class="display-3">Title</h1>
D. <h1 class="title display3">Title</h1>

Solution

  1. Step 1: Recall Bootstrap class syntax

    Bootstrap classes are added using the class attribute with the exact class name, e.g., class="display-3".
  2. Step 2: Check each option for correct syntax

    <h1 class="display-3">Title</h1> uses class="display-3" correctly. Other options misuse attribute syntax or class names.
  3. Final Answer:

    <h1 class="display-3">Title</h1> -> Option C
  4. Quick Check:

    Use class="display-x" for display headings [OK]
Hint: Always use class="display-x" syntax for Bootstrap classes [OK]
Common Mistakes:
  • Omitting the class attribute
  • Writing class names without quotes
  • Using incorrect attribute names
3. What will be the visual difference between these two headings in a Bootstrap page?
<h2 class="display-1">Big Heading</h2>
<h2>Normal Heading</h2>
medium
A. The 'Big Heading' text will be much larger and bolder than 'Normal Heading'.
B. Both headings will look the same size and weight.
C. 'Normal Heading' will be larger than 'Big Heading'.
D. 'Big Heading' will be hidden on small screens.

Solution

  1. Step 1: Understand the effect of display-1 class

    The display-1 class makes text very large and bold compared to normal heading styles.
  2. Step 2: Compare the two headings visually

    The first heading with display-1 will appear much bigger and bolder than the second heading without any display class.
  3. Final Answer:

    The 'Big Heading' text will be much larger and bolder than 'Normal Heading'. -> Option A
  4. Quick Check:

    display-1 = biggest heading style [OK]
Hint: Display-1 is the largest heading style in Bootstrap [OK]
Common Mistakes:
  • Assuming display classes do not change size
  • Thinking normal headings are bigger
  • Confusing display classes with visibility classes
4. Identify the error in this Bootstrap heading code:
<h3 class="display5">Heading</h3>
medium
A. The <h3> tag cannot use display classes
B. The class name should be display-4 with a dash, not display5
C. The heading text must be inside a <div> to use display classes
D. The class attribute is missing quotes

Solution

  1. Step 1: Check Bootstrap display class naming

    Bootstrap display classes use a dash, e.g., display-1, display-2, up to display-4. There is no display5 class.
  2. Step 2: Identify the mistake in the code

    The code uses display5 without a dash, which is invalid and will not apply the style.
  3. Final Answer:

    The class name should be display-4 with a dash, not display5 -> Option B
  4. Quick Check:

    Display classes require dash, e.g., display-1 [OK]
Hint: Remember display classes have a dash: display-1, display-2, etc. [OK]
Common Mistakes:
  • Omitting the dash in class names
  • Thinking display classes only work on <h1>
  • Missing quotes around class attribute
5. You want to create a page with a main heading that is very large and bold, and a subheading that is smaller but still styled with Bootstrap display classes. Which combination is correct?
hard
A. <h1 class="display-1">Main Title</h1> <h2 class="display-4">Sub Title</h2>
B. <h1 class="display-4">Main Title</h1> <h2 class="display-1">Sub Title</h2>
C. <h1>Main Title</h1> <h2>Sub Title</h2>
D. <h1 class="display-5">Main Title</h1> <h2 class="display-3">Sub Title</h2>

Solution

  1. Step 1: Understand Bootstrap display class sizes

    Display classes range from display-1 (largest) to display-4 (smaller). There is no display-5.
  2. Step 2: Choose correct class order for main and subheading

    Main heading should use display-1 for biggest size, subheading can use display-4 for smaller but styled text.
  3. Step 3: Verify semantic tags and classes

    <h1 class="display-1">Main Title</h1> <h2 class="display-4">Sub Title</h2> uses correct classes and semantic tags. Other combinations either use non-existent classes like display-5, reverse the size order (smaller main heading with display-4, larger subheading with display-1), or omit display classes entirely.
  4. Final Answer:

    <h1 class="display-1">Main Title</h1> <h2 class="display-4">Sub Title</h2> -> Option A
  5. Quick Check:

    Main heading bigger with display-1, subheading smaller display-4 [OK]
Hint: Use display-1 for main, display-4 for subheading [OK]
Common Mistakes:
  • Using display classes in wrong size order
  • Using non-existent display-5 class
  • Not applying display classes to subheading
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard