Good habit

Tip #3 on Attributes

Always Quote Values Containing Spaces

It is necessary to use quotes on attribute values which contain spaces:

HTML file: Displayed by browser:
<p title=About W3Schools>

When the cursor hovers over this paragraph, your browser will display the first word from an unquoted value or the entire quoted value from the TITLE attribute.</p>

When the cursor hovers over this paragraph, your browser will display the first word from an unquoted value or the entire quoted value from the TITLE attribute.

<p title="About W3Schools">

When the cursor hovers over this paragraph, your browser will display the first word from an unquoted value or the entire quoted value from the TITLE attribute.</p>

When the cursor hovers over this paragraph, your browser will display the first word from an unquoted value or the entire quoted value from the TITLE attribute.


Good habit Using quotes are most common. Omitting quotes can produce errors. A good habit is to always use quotes with attribute values.
Back button Table of Contents Next button