Bootstrap 5 Reboot Code blocks are used to put the code inside of <pre> tag, according to official docs we recommend that you avoid using any angle brackets inside of <pre> tags. This is used to remove the default margin of the HTML pre tag element.
BootStrap5 Reboot Code blocks Class: There is no predefined class to do the Reboot Code Blocks.
BootStrap5 Reboot Code blocks Tags: The HTML code tag has to use with the Bootstrap CDN link, it removes the extra space.
Syntax:
<pre> <code> ... </code> </pre>
The below examples illustrate the BootStrap5 Reboot Code blocks:
Example 1: In this example, we will put some C code inside the <pre> and <code> tags without the formatting.
<!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:
Example 2: In this example, we will put some C code inside of the <pre> & <code> tag with the formatting by putting them in a <pre> tag, and because of the <pre> tag, it removes the color.
<!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 Code blocks
</ strong >
</ center >
< pre >
< code >
#include< stdio.h >
int main() {
printf("Hello Geeks");
}
</ code >
</ pre >
</ body >
</ html >
|
Output:
Reference: https://getbootstrap.com/docs/5.1/content/reboot/#code-blocks