Bootstrap provides a number of classes for displaying inline and multiline blocks of code.
Displaying Inline Code: Inline code should be wrapped in <code> tags. The resulting text will be displayed in a fixed-width font and given a red font color.
> tags should be replaced with < and > respectively.
Below is an example displaying inline code using <code> tags in Bootstrap:
Displaying Multiline Code Blocks: Multiline code should be wrapped in
<pre> tags. The resulting text will be displayed in a fixed-width font with spaces and line breaks being preserved.
.pre-scrollable class can be optionally added which sets the max height of the element to be 350px and adds a vertical scrollbar.
Below is an example displaying block of code:
Indicating Sample Output: If it is needed to display output of any compiled program, in that case to indicate the output of a program, one can wrap the output using
Representing Variables: Variables could be indicated using the
User Input: User input could be styled using the
<kbd> tags as shown in the below program.
- Bootstrap (Part-4) | Vertical Forms, Horizontal Forms, Inline Forms
- What is the difference between inline-flex and inline-block in CSS?
- What is the difference between display: inline and display: inline-block in CSS?
- Displaying XML Using CSS
- Displaying XML Using XSLT
- Include Bootstrap in AngularJS using ng-bootstrap
- Inline function in C
- Blocks in PL/SQL
- How to write a:hover in inline CSS?
- Type Aliases vs Inline Classes
- HTML | Block and Inline Elements
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.