Open In App

Bootstrap 4 | Typography

Typography is a feature of Bootstrap for styling and formatting the text content. It is used to create customized headings, inline subheadings, lists, paragraphs, aligning, adding 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.

Typography can be used to create:



Tags and class to implement typography feature in bootstrap:

Example 1: This example uses heading class to display the heading.






<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        Bootstrap Typography example
    </title>
    <meta charset="utf-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href=
    <script src=
    </script>
    <script src=
    </script>
    <script src=
    </script>
</head>
<body>
    <div class="container">
        <h1>Heading Lists</h1>
        <h1 class="display-1">GeeksforGeeks</h1>
        <h1 class="display-2">GeeksforGeeks</h1>
        <h1 class="display-3">GeeksforGeeks</h1>
        <h1 class="display-4">GeeksforGeeks</h1>
    </div>
</body>
</html>

Output:

Example 2: This example uses <mark> tag to display the importance of text.




<!DOCTYPE html>
<html lang="en">
<head>
    <title>Bootstrap Typography example</title>
    <meta charset="utf-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href=
    <script src=
    </script>
    <script src=
    </script>
    <script src=
    </script>
</head>
<body>
    <div class="container">
        <h1>GeeksforGeeks</h1>
         
<p>A <mark>computer science</mark>
            portal for geeks</p>
 
    </div>
</body>
</html>

Output:


Supported Browser:


Article Tags :