Skip to content
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Loops and Control Flow
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python Exception Handling
- Python File Handling
- Python Exercises
- Java
- Java Programming Language
- Java Collections
- Java 8 Tutorial
- Java Programs
- Java Interview Questions
- Java Exercises
- Java Quiz
- Java Projects
- Advance Java
- Programming Languages
- System Design
- Interview Corner
- Computer Science Subjects
- Operating System
- DBMS
-
Last Updated : 16 Jan, 2019
Summarize
Comments
Improve
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.
Note: The<
and>
tags should be replaced with < and > respectively.Below is an example displaying inline code using <code> tags in Bootstrap:
<!DOCTYPE html>
<
html
>
<
head
>
<!-- Include Bootstrap CSS -->
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
>
<
title
>Displaying Inline Code</
title
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
h3
>Inline Code</
h3
>
<
p
>
We define paragraphs in HTML using the
<
code
><
p
></
code
> tag.
</
p
>
</
div
>
</
body
>
</
html
>
Output:
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.The
.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:
<!DOCTYPE html>
<
html
>
<
head
>
<!-- Add Bootstrap CSS -->
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
>
<
title
>Bootstrap Playground</
title
>
</
head
>
See AlsoGet started with BootstrapHow to Add CSS in Ruby on Rails? - GeeksforGeeksHow to add Bootstrap to your projectHow to add Bootstrap 4.4.1 to Rails<
body
>
<
div
class
=
"container"
>
<
h3
>Code Blocks</
h3
>
<!-- This block is not scrollable -->
<
pre
>
<
code
>
<!-- Lines of code starts -->
<
h1
>Title One</
h1
>
<
p
>A line of sample text</
p
>
<
p
>Another line of sample text</
p
>
<
p
>Yet another line of sample text</
p
>
<!-- Lines of code ends -->
</
code
>
</
pre
>
<
h3
>Code blocks using .pre-scrollable class</
h3
>
<!-- This block is vertically scrollable -->
<
pre
class
=
"pre-scrollable"
>
<
code
>
<!-- Lines of Code Starts -->
<
h1
>Title One</
h1
>
<
p
>A line of sample text</
p
>
<
p
>Another line of sample text</
p
>
<
p
>Yet another line of sample text</
p
>
<!-- Lines of code ends -->
</
code
>
</
pre
>
</
div
>
</
body
>
</
html
>
Output:
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
<samp>
tags.<!DOCTYPE html>
<
html
>
<
head
>
<!-- Add Bootstrap CSS -->
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
>
<
title
>Bootstrap Playground!</
title
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
h3
>Sample Output</
h3
>
<!-- Below is a sample output text displayed
using the samp tags -->
<
samp
>
The sample output text is displayed
in a fixed-width font.
</
samp
>
</
div
>
</
body
>
</
html
>
Output:
Representing Variables: Variables could be indicated using the
<var>
tag.<!DOCTYPE html>
<
html
>
<
head
>
<!-- ADD Bootstrap CSS -->
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
>
<
title
>Bootstrap Playground</
title
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
h3
>Variables</
h3
>
<
var
>y</
var
> = <
var
>m</
var
><
var
>x</
var
>
+ <
var
>c</
var
>
</
div
>
</
body
>
</
html
>
Output:
User Input: User input could be styled using the
<kbd>
tags as shown in the below program.<!DOCTYPE html>
<
html
>
<
head
>
<!-- ADD Bootstrap CSS -->
<
link
rel
=
"stylesheet"
href
=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
>
<
title
>Hello, world!</
title
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
h3
>User input</
h3
>
<!-- In the below tags kbd tags is used to
highlight inputs -->
Type <
kbd
>ls</
kbd
> to list all files in the
current directory. <
br
>
To copy files, select the files and
press <
kbd
><
kbd
>ctrl</
kbd
> + <
kbd
>c</
kbd
></
kbd
><
br
>
To paste files, select the files and
press <
kbd
><
kbd
>ctrl</
kbd
> + <
kbd
>v</
kbd
></
kbd
><
br
>
</
div
>
</
body
>
</
html
>
Output:
Please Login to comment...
Similar Reads
Blaze UI Typography Inline and Multiline code
Blaze UI is a CSS open-source framework. It is a lightweight UI toolkit and provides great tools for building customized and scalable applications. It can work with any framework that exists. It can adapt to any ecosystem. All designs or CSS are mobile-first and hence responsive. It project is available open-source so a large community maintains it
2 min read
BootStrap 5 Reboot Code blocks
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
2 min read
What is the difference between display: inline and display: inline-block in CSS?
The display property in CSS is a very useful and commonly used property that contains many values. The display property defines how an HTML element should be displayed on the webpage. The property also specifies the type of box used for an HTML element and how it should be laid out on the page. If we need to display the elements that are laid out a
4 min read
What is the difference between inline-flex and inline-block in CSS?
The display property specifies how an element should be displayed on a webpage. There can be many values, related to this property in CSS. Inline-block and inline-flex are two such properties. Although there are several values that this property can have, to understand the aforementioned, let us first look into three other values: inline, block, an
3 min read
How display: inline is different from display: inline-block in CSS ?
In this article, we will know about the display property in CSS, along with understanding the 2 different property values for display property, i.e., display: inline & display: inline-block properties, & will understand their basic differences & implementation through the examples. The display property facilitates setting the element by
3 min read
BootStrap 5 Reboot inline code
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 sepa
2 min read
Convert JSON file into CSV file and displaying the data using Node.js
There are so many ways to store data for better understanding for individual purposes, in few cases, JSON files will be more suitable in few cases, CSV files, and there are also lots of other types as well like XML, etc. In this article, we will convert the JSON file data into CSV file data and also display that through Node.js. JSON stands for Jav
3 min read
Displaying XML Using CSS
XML stands for Extensible Markup Language. It is a dynamic markup language. It is used to transform data from one form to another form. An XML file can be displayed using two ways. These are as follows :- Cascading Style Sheet Extensible Stylesheet Language Transformation Displaying XML file using CSS : CSS can be used to display the contents of th
4 min read
Displaying XML Using XSLT
XSLT stands for Extensible Stylesheet Language Transformation. XSLT is used to transform XML document from one form to another form. XSLT uses Xpath to perform matching of nodes to perform these transformation . The result of applying XSLT to XML document could be an another XML document, HTML, text or any another document from technology perspecti
3 min read
JavaScript RegExp multiline Property
The multiline Property property in Javascript is used to specify whether the "m" modifier is set or not. If the "m" modifier is set than this property returns true else false. Syntax: RegexObj.multiline Return Value: It returns true if m modifier is set, else false. Example 1: This example checks if the regular expression contains m Modifier or not
1 min read
How to create a multiline input control text area in HTML5 ?
The HTML <textarea> tag is used to specify a multiline input control text area in HTML5. The <cols> and <rows> attributes specify size of a textarea. Syntax <textarea rows="" cols=""> Contents... </textarea> The <textarea> tag contains 5 attributes that are listed below: cols: It specifies width of textarea.rows:
1 min read
How to split multiline string into an array of lines in JavaScript ?
Multiline string in JavaScript means a string having two or more lines. To split a multiline string into an array we need to use split() in our JavaScript code. JavaScript split(separator, limit) Method: The split() function is used to split the data depending upon the attributes we are passing in it. The separator attributes specify that from this
2 min read
Spectre Multiline Tooltips
Spectre Tooltips are quite useful for showing the description of different elements in the webpage. Tooltip can be invoked on any element in a webpage. It provide context information labels that appear on hover and focus. Tooltips component is built entirely in CSS. The normal tooltip will try to display the data-tooltip content in a single line, s
2 min read
Bulma Multiline Option
Bulma is a free and open-source CSS framework used to build responsive and beautiful websites. It is based on flexbox. In this article, we will be seeing the multiline option in columns in Bulma. So, by default, all the columns inside a column container will be in the same row but we can use the is-multiline modifier on the columns container to mak
2 min read
Vue.js Form Input Binding with Multiline text
Vue.js is a progressive javascript framework for developing web user interfaces. It is a versatile framework providing high speed and performance. We can create Single Page Applications as well as Full Stack applications. Input Binding is used to sync and maintain the state of form input elements with the corresponding state in javascript. So, Vue.
2 min read
React.js Blueprint Editable text Component Multiline mode
BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Editable Text Component provides a way for users to provide content that is editable when the user clicks on it. Editable text Component Multiline Mode Properties: multiline: A
3 min read
How to Apply an Ellipsis to Multiline Text in CSS ?
Ellipsis refers to three dots (...) and is a user-friendly UI modification that indicates more information is available but has been truncated due to lack of space. In this article, we will explore two approaches to applying ellipses to multi-line text in CSS. Understanding Ellipsis in CSSEllipsis helps in providing a visual cue to users that there
3 min read
How to Switch Textarea to Multiline When Overflown with Text in CSS ?
In this article, we will see how the textarea can be switched to multiline while the text is overflowing, along with understanding the different ways to accomplish this task along with its implementation. Many times we have seen when users are typing in a textarea, they might not always know how much text will fit into the box. As a result, the tex
3 min read
How to Display Validation Message for Radio Buttons with Inline Images using Bootstrap?
By default, Bootstrap 4 has various form features for radio buttons with images inline. Here HTML 5 has default validation features, However, for custom validation, we must use JavaScript or jQuery. Below are the approaches that would help in displaying validation messages for radio buttons with images inline: Table of Content Using Inline ImageUsi
4 min read
Which tags are used to displaying data in tabular form in HTML ?
In this article, we will discuss the tags used to display the data in tabular form. Tags: Tags are the starting and ending parts of an HTML element. Every tag starts with the "<" symbol and ends with the">" symbol. Whatever inside these symbols are called tags. Opening and closing tags are used to store any information inside the tag. Opening
3 min read
Spectre Inline code
The HTML code element is used to style the inline code and the code snippet. In this article, we will learn about the Inline code. Inline code is a line of the actual code. For inline code, you can use the <code> element. Spectre Inline code class: There is no predefined class for this, we can use the <code> tag for the inline code. Syn
1 min read
Bootstrap 5 Checks and radios Inline
Bootstrap 5 Checks and radios Inline can be used to align the checkbox or radio horizontally in the same line. Bootstrap 5 Checks and radios Inline Class: form-check-inline: This class makes all the checkboxes or radios inline or beside each other which are inside the div having this class. Syntax: <div class="form-check form-check-inline"> .
2 min read
How to Apply Bootstrap Grid for Inline Elements ?
The Bootstrap Grid System is a flexible and responsive layout system that allows developers to create complex and responsive web layouts. The grid system uses a series of classes and CSS styles to create rows and columns. The grid system is built using the flexbox layout model, which allows elements to be easily resized and repositioned based on th
4 min read
Bootstrap 5 Typography Inline text elements
Bootstrap5 Typography Inline text elements will get an output like HTML tags output without the help of HTML tags, instead, Inline text element classes are used. Inline text elements Classes: mark: This class is used to highlight or mark the element. This works like <mark>( HTML) tag.small: This class is used to make elements small. This work
2 min read
Bootstrap 5 Typography Lists Inline
Bootstrap 5 Typography Lists Inline classes are used to remove a list’s bullets and apply some light margin. Sometimes we need to put listed elements in a horizontal manner. Typography Lists Inline Classes: list-inline: This class is used to make the list item left most aligned.list-inline-item: This class is used to remove the dots or numbers from
2 min read
BootStrap 5 Reboot Inline elements
BootStrap 5 Reboot Inline elements are used to put some elements abbreviations or short forms of an element that receive basic styling to make it different than other text. Reboot Inline elements Tag used: By using <abbr> Tag we can use the styling to make it look different from paragraph text. Reboot Inline elements Class used: There is no p
1 min read
What is the use of form-inline Class in Bootstrap ?
The .form-inline class in Bootstrap is used to create horizontally aligned forms. It allows form elements, such as input fields and buttons, to be displayed on the same line, making them suitable for compact layouts, inline form groups, or search bars. Preview:Syntax:<form class="form-inline"> <!-- Form elements go here --></form>
1 min read
Bootstrap 5 Layout Inline forms
Bootstrap 5 Layout Inline forms consist of a responsive horizontal layout. All of the elements are inline and left-aligned, and labels are alongside, and only apply to forms within viewports. Bootstrap 5 Layout Inline forms used classes: row-cols-lg-auto: This class is used to create horizontal layouts.input-group: This class is used to enhance an
2 min read
How to universally parse JSON into blocks using jQuery ?
In jQuery, to parse any data to any block is carried over by using DOM Insertion methods. Some of DOM Insertion methods are append(), appendTo(), html(), prepend(), prependTo(), text(). To parse JSON into any block is also handled in same way but along with Ajax callback functions and parse.JSON() methods. Here parse.JSON() methods is deprecated in
3 min read
How to Place Text Blocks Over an Image using CSS?
Placing text blocks over an image is a common technique used in web design to create visually appealing layouts. Here, we will explore different approaches to achieve this effect using CSS. Below are the approaches to place text blocks over an image using CSS: Table of Content Using Absolute PositioningUsing CSS background-imageUsing Absolute Posit
2 min read
Article Tags :
Trending in News
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
- Python Tutorial
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, check: true }), success:function(result) { jQuery.ajax({ url: writeApiUrl + 'suggestions/auth/' + `${post_id}/`, type: "GET", dataType: 'json', xhrFields: { withCredentials: true }, success: function (result) { $('.spinner-loading-overlay:eq(0)').remove(); var commentArray = result; if(commentArray === null || commentArray.length === 0) { // when no reason is availaible then user will redirected directly make the improvment. // call to api create-improvement-post $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); return; } var improvement_reason_html = ""; for(var comment of commentArray) { // loop creating improvement reason list markup var comment_id = comment['id']; var comment_text = comment['suggestion']; improvement_reason_html += `
${comment_text}
`; } $('.improvement-reasons_wrapper').html(improvement_reason_html); $('.improvement-bottom-btn').html("Create Improvement"); $('.improve-modal--improvement').hide(); $('.improvement-reason-modal').show(); }, error: function(e){ $('.spinner-loading-overlay:eq(0)').remove(); // stop loader when ajax failed; }, }); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ $('.improvement-reason-modal').hide(); } $('.improve-modal--improvement').show(); }); function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function suggestionCall() { var suggest_val = $.trim($("#suggestion-section-textarea").val()); var array_String= suggest_val.split(" ") var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(suggest_val.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `
${suggest_val}
`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-section-textarea').val(""); jQuery('.suggest-bottom-btn').css("display","none"); // Update the modal content const modalSection = document.querySelector('.suggestion-modal-section'); modalSection.innerHTML = `
Thank You!
Your suggestions are valuable to us.
You can now also contribute to the GeeksforGeeks community by creating improvement and help your fellow geeks.
`; }, error:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000."); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('#suggestion-section-textarea').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // load the captcha script and set the token loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY',[], function() { setGoogleRecaptcha(); }); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.improvement-reason-modal').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); });