

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add preformatted text in HTML?
Use the <pre> tag to add preformatted text in HTML. The HTML <pre> tag is used for indicating preformatted text. The code tag surrounds the code being marked up.
Browsers normally render pretext in a fixed-pitched font, with whitespace intact, and without word wrap.
Example
You can try to run the following code to learn how to work with <pre> tag −
<!DOCTYPE html> <html> <head> <title>HTML pre Tag</title> </head> <body> <pre> This text is in a fixed-pitch font, and it preserves both spaces and line breaks </pre> </body> </html>
- Related Questions & Answers
- How do we create preformatted text in HTML?
- How to render the remainder of the document as preformatted plain text in HTML?
- How to add a spellchecker for text in HTML?
- How do we add bold text in HTML?
- How to center text in HTML?
- How to add various fonts to text using text flow in JavaFX?
- How to add shadow on text swift?
- How to add bold annotated text in Matplotlib?
- How to set text direction in HTML?
- How to set Text alignment in HTML?
- How to make text bold in HTML?
- How to make text italic in HTML?
- How to change text font in HTML?
- How to underline a text in HTML?
- How to mark deleted text in HTML?
Advertisements