# HTML5 (Quotes around href links?)

This topic is 2776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have come across something interesting on webpages, and that is sometimes the links are missing the quotes.
For example they read [color=#0000ff]href=../index.php as opposed to [color=#0000ff]href="../index.php".

I thought the scheme for HTML is and has always been variableName="data" ?

Just curious, are these quotes optional?
Should one include the quotes?
Does HTML no longer require quotes?

CoderWalker

##### Share on other sites
Remember that HTML5 has not yet been standardized. However, usually when there is a question regarding the specifications of a language, checking the actual language specifications can prove a fruitful adventure. I googled "html5 w3c" and found a working draft for HTML5, searched the page for "attribute" and quickly found this section:

Attributes are placed inside the start tag, and consist of a name and a value, separated by an "=" character. The attribute value can remain unquoted if it doesn't contain space characters or any of " '  = < or >. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=" character, can be omitted altogether if the value is the empty string.
[/quote]

(emphasis mine)

##### Share on other sites

Remember that HTML5 has not yet been standardized. However, usually when there is a question regarding the specifications of a language, checking the actual language specifications can prove a fruitful adventure. I googled "html5 w3c" and found a working draft for HTML5, searched the page for "attribute" and quickly found this section:

Attributes are placed inside the start tag, and consist of a name and a value, separated by an "=" character. The attribute value can remain unquoted if it doesn't contain space characters or any of " '  = < or >. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=" character, can be omitted altogether if the value is the empty string.

(emphasis mine)
[/quote]

Thanks a ton for the link to the specs as well as the answer! Much appreciated!
I knew there were specifications someone online, but I wasn't 100% sure, and there are millions of HTML5 pages.

##### Share on other sites

I knew there were specifications someone online, but I wasn't 100% sure, and there are millions of HTML5 pages.

Yeah, I know how you feel. I've started to try and tell people how I find the answer, because I know there are times when I've been fascinated with "how did you know that" or "how did you find that" and so I'm experimenting with telling people how I know/found the answer.

##### Share on other sites
HTML traditionally does not require quotes for attribute values. There is/was a flavor of HTML called XHTML, where the HTML is also valid XML, which tightens up a lot of those problems. I personally like it a lot, but it's not what is "standard" on the web.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26