White Space and Flow

Spaces, tabs and new lines are all called as white spaces. White spaces given in the source HTML is taken as a single space and would also appear as one space by the browser. This phenomenon is called white space collapsing. A new line or consecutive empty lines, all these are treated as one space.

<p>The

lines of

this paragraph

are present on

multiple lines

and also space between

words are

treated as a single space. Also

the large spaces between

some of the

words will also not appear

in the

browser.

This is how white space just collapses as a single space.</p>

Browser displays text in the full width of the screen and wraps the text onto new lines when no space is present. White space collapsing helps in adding spaces in web page for commenting which does not show in a browser as shown

VS-1027 Certified HTML Designer_Reading_Material_html_m1368a5b2

Apply for HTML Certification

https://www.vskills.in/certification/certified-html-designer

Back to Tutorials

Viewing the Source
HTML Comments

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?