HTML Tips and TricksPost your HTML Related tips and tricks here
Notices
Welcome to the Aio® forum.
You are currently viewing AIOFORUM as a guest which gives you VERY limited access to view most discussions, Applications, Latest Movies & Tutorials and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload and Download content and access many other special features. Registration is fast, simple and absolutely free so please, Join our community today!
If you have any problems with the registration process or your account login, please use Contact us.
The <!DOCTYPE> declaration is the very first thing in your document, before the <html> tag. This tag tells the browser which HTML or XHTML specification the document uses. Tips and Notes
Note: The <!DOCTYPE> tag does not have an end tag! HTML
HTML 4.01 specifies three document types: Strict, Transitional, and Frameset. HTML Strict DTD
Use this when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> HTML Transitional DTD
The Transitional DTD includes presentation attributes and elements that W3C expects to move to a style sheet. Use this when you need to use HTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Frameset DTD
The Frameset DTD should be used for documents with frames. The Frameset DTD is equal to the Transitional DTD except for the frameset element replaces the body element:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> XHTML
XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset. XHTML Strict DTD
Use this DTD when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> XHTML Transitional DTD
Use this DTD when you need to use XHTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> XHTML Frameset DTD
Use this DTD when you want to use frames!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> To check that you have written a valid XHTML document with a correct DTD, you can link your XHTML page to an XHTML validator.
Attributes: NONE
The following elements are all font style elements. They are not deprecated, but it is possible to achieve richer effects using style sheets. <tt> Renders as teletype or mono spaced text <i> Renders as italic text <b> Renders as bold text <big> Renders as bigger text <small> Renders as smaller text Differences Between HTML and XHTML
NONE Example
Source Output <tt>Teletype text</tt><br />
<i>Italic text</i><br />
<b>Bold text</b><br />
<big>Big text</big><br />
<small>Small text</small><br /> Teletype text Italic text Bold text
Big text
Small text
The <font> tag specifies the font face, font size, and font color of text. Differences Between HTML and XHTML
The font element was deprecated in HTML 4.01.
The font element is not supported in XHTML 1.0 Strict DTD. Tips and Notes
Tip: Use styles (instead of the <font> tag) to define the font face, font size, and font color of text. Example
Source Output <font size="3" color="red">
This is some text!
</font>
<font size="1" color="blue">
This is some text!
</font>
<font face="arial" color="red">
This is some text!
</font> This is some text! This is some text! This is some text! Optional Attributes
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute Value Description DTD color rgb(x,x,x)
#xxxxxx
colorname Defines the color of the text in the font element. Deprecated. Use styles instead TF face list_of_fontnames Defines the font of the text in the font element. Deprecated. Use styles instead TF size A number from 1 to 7.
If basefont is specified you can specify a number from -6 to 6 Defines the size of the text in the font element. Deprecated. Use styles instead TF