HTML Pretty

What is HTML Pretty?

HTML Pretty refers to formatting HTML code in a way that makes it easier to read and understand. It organises the code with proper indentations, line breaks, and sometimes colours to enhance readability.

When HTML code is "pretty-printed," the structure is visually clear, making it easier to follow and debug, especially when working with large or complex documents.

Key features of HTML Pretty

  • Easier to Read: It organises the code into a clean, readable structure.
  • Helps with Debugging: You can quickly spot errors or issues in the HTML markup.
  • Improves Understanding: It helps anyone viewing the HTML understand the document structure at a glance.

Example:

Raw HTML:

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>My Website</title></head><body><h1>Welcome to My Website</h1><p>This is a simple paragraph.</p></body></html>

Pretty-Printed HTML:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>My Website</title>
  </head>
  <body>
    <h1>Welcome to My Website</h1>
    <p>This is a simple paragraph.</p>
  </body>
</html>

In the pretty-printed version, the structure is clear and easy to read, making it easier to work with.