HTML Display

Browsers display the content based on the HTML tags used.

Browsers ignore all the extra spaces and lines outside and within the HTML elements, so we cannot change the display by adding extra spaces and lines to the HTML code.

Content is displayed based on how the browser process the HTML code, so we may see some minor differences between the browsers.

The display may change between different screen sizes as well.

Examples

Both the paragraphs in the below example are displayed as the same.

<!doctype html>
<html lang="en">
<head>
</head>
<body>
    <h1>Browsers ignore all the extra spaces and lines outside and inside the HTML elements while displaying the content.</h1>
    
    <h3>Paragraph 1</h3>
    <p>Paragraph content goes here.</p>
    
    <h3>Paragraph 2</h3>
    <p>Paragraph
         content

         goes here.
    </p>
</body>
</html>

Overall

Browsers ignore extra spaces and lines within the HTML content while displaying.