Open In App

BootStrap 5 Reboot inline code

Last Updated : 29 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

BootStrap 5 Reboot inline code is used to wrap the code in actual code form. To do so we can use the HTML code tag. This is used when we want the normal text to look like a code.  During the creation of web pages sometimes there is a need to display computer programming code. It could be done by any basic heading tag of HTML but HTML provides a separate tag which is <code>.

Reboot inline code Tag used:  We need to put the text inside the <code> tag element. It changes the color of the text and removes the default margin as well.

Reboot inline code class used: There is no predefined class to wrap the text into code form

Syntax:

<code> 
    ... 
</code>

Example 1: In this example, we will put some C code inside the code tag without the formatting.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <link href=
          rel="stylesheet"
          integrity=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
          crossorigin="anonymous">
</head>
  
<body class="m-3">
    <center>
        <h1 class="text-success">
            GeeksforGeeks
        </h1>
        <strong>
              BootStrap5 Reboot inline code
          </strong>
    </center>
    <code>
        #include>stdio.h>
            int main() {
            printf("Hello Geeks");
            }
    </code>
</body>
  
</html>


Output:

BootStrap5 Reboot inline code

Example 2: In this example, we will put some C code inside of the code tag with the formatting by putting them in a pre-tag, and because of pre tag it removes the color.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <link href=
          rel="stylesheet"
          integrity=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
          crossorigin="anonymous">
</head>
  
<body class="m-3">
    <center>
        <h1 class="text-success">
            GeeksforGeeks
        </h1>
        <strong>
              BootStrap5 Reboot inline code
          </strong>
    </center>
    <pre>
        <code>
            #include<stdio.h>
                int main() {
                printf("Hello Geeks");
                }
        </code>
    </pre>
</body>
  
</html>


Output:

BootStrap5 Reboot inline code

Reference: https://getbootstrap.com/docs/5.0/content/reboot/#inline-code



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads