HTML Tutorials - Herong's Tutorial Examples - Version 2.01, by Dr. Herong Yang
Specifying Element Attributes
This section describes how to specify element attributes in quoted text values, bare text values or minimization format.
Attributes are supported on HTML elements and they should be entered in one of these formats:
1. Attributes with Quoted Values - Attribute values are specified as quoted text strings. This is the recommended format. Here is a good example:
<img src="picture.jpg" alt="It's a boy!"/>
2. Attributes with Bare Values - Attribute values are specified as bare text strings. Here is a good example:
<img src=picture.jpg alt=Blue_Sky/> The above format is not recommended. Use the format below: <img src="picture.jpg" alt="Blue_Sky"/>
3. Attributes with no Explicit Values (Attribute Minimization) - Some Boolean attributes can be specified without explicitly providing any values. Here is a good example:
<button type="button" disabled>Try me later!</button> The above format is not recommended. Use the format below: <button type="button" disabled="disabled">Try me later!</button>
4. Attribute Name - HTML attribute names are case insensitive. For example, "src" and "SRC" are identical. It is strongly recommended that you always use lower case letters in attribute names.
5. Reserved Characters - When HTML reserved characters are part of attribute values, they must be replaced with their entity references listed below:
< < > > & & " "
Last update: 2014.
Table of Contents