Techno Blender
Digitally Yours.

Bootstrap 5 Typography – GeeksforGeeks

0 21


Improve Article

Save Article

Like Article

Improve Article

Save Article

Bootstrap 5 Typography is a feature of Bootstrap for styling and formatting text content. It is used to create customized headings, inline subheadings, lists, and paragraphs, align, add more design-oriented font styles, and much more. Bootstrap support global settings for the font stack, Headings and Link styles to be used in the web app for every type of OS and Device to deliver the best user interface.

Bootstrap 5 Typography:

  • Headings: For heading, classes are available from [.h1 to .h6]. Heading classes help us create a font-style-like heading without the use of HTML heading tags.
  • Display headings: Display headings are used to create a heading if it has a larger (larger font size and lighter font weight than a regular heading. Display heading classes are from .display-1 to .display-6.
  • Lead: For creating a paragraph that standouts from other paragraphs .lead class is used.
  • Inline text elements: The inline text-elements provide a method to style the common HTML elements.For ex: If we want to highlight a text in the paragraph we can use <mark> tag.
  • Text utilities: The text utilities are used for changing text alignment, style, weight, line-height, and other decorations.
  • Blockquotes: The <blockquote> tag in HTML is used to display long quotations (a section that is quoted from another source). It changes the alignment to make it unique from others. It contains both opening and closing tags.
  •  Lists: This method is basically used to style the list added on the webpage. By using this method we can remove the pre-defined styles on the lists and add new styles.

Syntax:

<p class="Typography classes">
    ...
</p>

Example 1:  Let us see an example of Typography Headings.

HTML

<!DOCTYPE html>

<html>

<head>

    

    <link rel="stylesheet" 

          href=

          crossorigin="anonymous">

</head>

  

<body class="m-5">

    <h1 class="text-success"

        GeeksforGeeks

    </h1>

    <h3>Bootstrap 5 Typography</h3>

  

    <div class="h6">GeeksforGeeks</div>

    <div class="h5">GeeksforGeeks</div>

    <div class="h4">GeeksforGeeks</div>

    <div class="h3">GeeksforGeeks</div>

    <div class="h2">GeeksforGeeks</div>

    <div class="h1">GeeksforGeeks</div>

</body>

</html>

Output:

 

Example 2: Let us see an example of display heading classes.

HTML

<!DOCTYPE html>

<html>

<head>

    

    <link rel="stylesheet" 

          href=

          crossorigin="anonymous">

</head>

  

<body class="m-5">

    <h1 class="text-success"

        GeeksforGeeks 

    </h1>

    <h3>Bootstrap5 Typography</h3>

    <p class="display-5">GFG 5</p>

    <p class="display-4">GFG 4</p>

    <p class="display-3">GFG 3</p>

    <p class="display-2">GFG 2</p>

    <p class="display-1">GFG 1</p>

</body>

</html>

Output:

 

Reference: https://getbootstrap.com/docs/5.0/content/typography/


Improve Article

Save Article

Like Article

Improve Article

Save Article

Bootstrap 5 Typography is a feature of Bootstrap for styling and formatting text content. It is used to create customized headings, inline subheadings, lists, and paragraphs, align, add more design-oriented font styles, and much more. Bootstrap support global settings for the font stack, Headings and Link styles to be used in the web app for every type of OS and Device to deliver the best user interface.

Bootstrap 5 Typography:

  • Headings: For heading, classes are available from [.h1 to .h6]. Heading classes help us create a font-style-like heading without the use of HTML heading tags.
  • Display headings: Display headings are used to create a heading if it has a larger (larger font size and lighter font weight than a regular heading. Display heading classes are from .display-1 to .display-6.
  • Lead: For creating a paragraph that standouts from other paragraphs .lead class is used.
  • Inline text elements: The inline text-elements provide a method to style the common HTML elements.For ex: If we want to highlight a text in the paragraph we can use <mark> tag.
  • Text utilities: The text utilities are used for changing text alignment, style, weight, line-height, and other decorations.
  • Blockquotes: The <blockquote> tag in HTML is used to display long quotations (a section that is quoted from another source). It changes the alignment to make it unique from others. It contains both opening and closing tags.
  •  Lists: This method is basically used to style the list added on the webpage. By using this method we can remove the pre-defined styles on the lists and add new styles.

Syntax:

<p class="Typography classes">
    ...
</p>

Example 1:  Let us see an example of Typography Headings.

HTML

<!DOCTYPE html>

<html>

<head>

    

    <link rel="stylesheet" 

          href=

          crossorigin="anonymous">

</head>

  

<body class="m-5">

    <h1 class="text-success"

        GeeksforGeeks

    </h1>

    <h3>Bootstrap 5 Typography</h3>

  

    <div class="h6">GeeksforGeeks</div>

    <div class="h5">GeeksforGeeks</div>

    <div class="h4">GeeksforGeeks</div>

    <div class="h3">GeeksforGeeks</div>

    <div class="h2">GeeksforGeeks</div>

    <div class="h1">GeeksforGeeks</div>

</body>

</html>

Output:

 

Example 2: Let us see an example of display heading classes.

HTML

<!DOCTYPE html>

<html>

<head>

    

    <link rel="stylesheet" 

          href=

          crossorigin="anonymous">

</head>

  

<body class="m-5">

    <h1 class="text-success"

        GeeksforGeeks 

    </h1>

    <h3>Bootstrap5 Typography</h3>

    <p class="display-5">GFG 5</p>

    <p class="display-4">GFG 4</p>

    <p class="display-3">GFG 3</p>

    <p class="display-2">GFG 2</p>

    <p class="display-1">GFG 1</p>

</body>

</html>

Output:

 

Reference: https://getbootstrap.com/docs/5.0/content/typography/

FOLLOW US ON GOOGLE NEWS

Read original article here

Denial of responsibility! Techno Blender is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected]. The content will be deleted within 24 hours.
Leave a comment