This project demonstrates the use of the <pre> HTML element to display preformatted text.
The <pre> element preserves whitespace, indentation, and line breaks, making it ideal for showing code blocks or structured text.
- Explanation of what the
<pre>element is. - Side-by-side comparison of regular text vs preformatted code.
- Example of JavaScript code formatted inside a
<pre><code>block. - Styled with a separate CSS file for readability and elegance.
index.html→ The main webpage.styles.css→ Styles for layout, typography, and<pre>formatting.README.md→ Project documentation (this file).
- Clone the repository or download the
index.htmlfile. - Open
index.htmlin a web browser to view the preformatted text examples. - Modify the content within the
<pre>tags to display your own preformatted text.
The page shows:
- A short explanation about
<pre>. - A block of preformatted notes.
- A JavaScript example in plain text vs preformatted code.
This project is for learning purposes. Free to use and adapt.