Jump to content

HTML5 and double quotes


mikhl

Recommended Posts

Hello. This is just a general curiosity question.

 

I am just wondering about peoples preferences with the use of double quotes in HTML5.

 

In XHTML and HTML5 the following is valid:

 

<div id="wrapper">

<div class="someClass">

	<p class="important">Some Content Here!</p>

</div>

</div>

 

However I hear that in HTML5 you can also choose to leave the double quotes out:

 

<div id=wrapper>

<div class=someClass>

	<p class=important>Some Content Here!</p>

</div>

</div>

 

I think it makes sense that they wouldn't be required. However, for the moment I am still using them to ensure there are no compatibility issues with any older browsers.

 

What do you think about this, do you think its a good idea?

What approach do you think we should be using now if we are coding HTML5 pages?

Link to comment
https://forums.phpfreaks.com/topic/266630-html5-and-double-quotes/
Share on other sites

While quotes are ostensibly optional for spaceless attribute values in HTML5, quotes are not optional for XHTML, and some parsers/browsers will not like unquoted strings.  There's no reason that I can see to not just "do it right" and quote all your attributes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.