Html Readers

HTML Doctype

|| « Go to Home || || Go to next » ||
The <!DOCTYPE> declaration tells the browser how to display a web page correctly by using HTML versions. When identify the document is HTML or XHTML, it is important to Add a Doctype declaration at the top web document. This makes sure the document will be parsed the same way by different browsers. HTML web pages always start with a document type definition (DTD). It tells the web browser to determine what type of HTML version you are using as well as the character is in what language. In HTML 4.0 and earlier have the type of DTD that is given below. In other, the first line of an HTML web page should be DTD.

The easiest way and most reliable doctype declaration to use is HTML 5 doctype.
 
<!DOCTYPE html>

Example

The <!DOCTYPE> declaration must be the specify at the top of in your HTML document, before the <html> start tag.Know More abot Doctype
Example
<!DOCTYPE html>
<html>
<head>
<title>This is a DOCTYPE exampe - htmlreaders.com</title>
</head>
<body>
<h1> This is a heading</h1>
<strong>There is display Bolder Text</strong>
<p> This is paragraph. There is a paragraph tag as markup definition for document structure</p>
</body>
</html>
Note:
we have used HTML 5 <!DOCTYPE> declaration in above example and all through the tutorial. 

HTML Doctype Declarations List

HTML5

 <!DOCTYPE html>

HTML 4.01 Transitional

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Strict

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Frameset

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0 Doctype Declarations List

XHTML 1.0 Transitional

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Strict

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Frameset

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Defined HTML Attributes

There are the four way to define HTML Attributes.

Empty Attribute Syntax

Write Just the attribute name.The value will be implicitly the empty string.
In the following example, the disabled attribute has a implicitly empty attribute value.
Example 1
<input disabled>
Note:
If an attribute using the empty attribute syntax is to be followed by another attribute, then there must be a space character separating the two.

Unquoted attribute value syntax

The attribute name come with single equal sign character, zero or more space characters, and with any attribute value, which provides additional requirements to the html element.

In Unquoted attribute value syntax the attribute value must not be the empty string and must not contain any Unicode characters like literal space characters, any QUOTATION MARK characters ("), APOSTROPHE characters ('), EQUALS SIGN characters (=), LESS-THAN SIGN characters (<), GREATER-THAN SIGN characters (>), or GRAVE ACCENT characters (`).
In the following example, the value attribute is used with the unquoted attribute value syntax:
Example 2
<input value=yes>
Note:
If an attribute using the unquoted attribute syntax is to be followed by another attribute , then there must be a space character separating the two.

Single-quoted attribute value syntax (' ')

The attribute name come with a single equal sign character, zero or more space characters, a single APOSTROPHE character (') and with attribute value, which provides additional requirements to the html element.

Single-quoted attribute value syntax, the attribute value must not contain any literal APOSTROPHE characters ('), and a second single APOSTROPHE character (').
In the following example, the type attribute has the single-quoted attribute value syntax
Example 3
<input type='text'>
<input type=' '>
<a href='http://www.htmlreaders.com/' title='single "equal sign" character'></a>

Note:
If the  HTML element, attribute using the single-quoted attributes syntax by using another attribute, then you must be use space between them  to keep separate. like  <input type='Text'  value='123'>

Double-quoted attribute value syntax (" ")

The attribute name come with a single EQUALS SIGN character, zero or more space characters, single QUOTATION MARK character (") Unicode characters and with attribute value, which provides additional requirements to the html element.

Double-quoted attribute value syntax, the attribute value must not contain any literal QUOTATION MARK characters ("), and a second single QUOTATION MARK character (") Unicodes.
In the following example, the type attribute has the single-quoted attribute value syntax
Example 4
<input type="text">
<input type=" ">
<input name="be text">
<a href="http://www.htmlreaders.com/" title="single 'equal sign' character"></a>
Note:
If the  HTML element, attribute using the double-quoted attribute syntax by using another attribute, then you must be using the space character between them  to keep separate. like  <input type="Text"  value="123">

W3c Org Recommendetion

Does not allow two or more attributes with name in the same start tag.
Attributes are always specified in the start tag.
All attributes are ASCII case-insensitive with uppercase or lowercase, like Title or TITLE match for each other.
You should use lowercase attributes in HTML.

|| « Go to Home || || Go to next » ||