Wednesday, October 17, 2012

XHTML Transitional, Strict and Frameset

| 0 comments
If we're talking about Web Standard, then we have to know about XHTML.
XHTML divided into 3 models : transitional, strict, and frameset.

Let's start with transitional and strict models.
For anyone who wants to move to XHTML technology, the easier way is to move to XHTML transitional, that's because XHTML transitional still allows the old tag to be used. If you  used to use HTML instead of XHTML strict, you'll be surprised when validating your website because of many invalid syntax in your script. XHTML strict use Cascading style sheet (css) to make a layout and the design.

The first thing we have to know is we should declare what type of our file. With this declaration, the browsers, search engines, or website validator will know what document type they are reading.


Here are the declaration :

  1. XHTML 1.0 STRICT


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

  2. XHTML 1.0 TRANSITIONAL



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

Unused Tags
Several HTML tags will not be used anymore in HTML Strict. the reason is they can be replaced with css.
1. <u> for underline can be replaced by text-decoration :underline in css
2. <Font> can be replaced by font property in cases which is the richer of style
3. <center> is replaced with text-align property.

The other tags are replaced : <i> replaced by <em> and <b> for bold replaced by <strong>.

How about the iframe tag?
iframe is not used anymore in XHTML transitional and strict, because it takes a page from the other source that can contain invalid code, and this will make your page known as invalid XHTML as well. So if you want to use it, then you have to declare your document as the XHTML frameset. Here is the declaration :


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

Unused Attributes

there are some attributes that have been removed in XHTML, they are align (except for table), target in <a> tag, the reasons from W3C are almost all recent browsers have been used tabbed model for their user interfaces besides the mobile phone and PDA can not display a new window.

Note: when working in XHTML strict, we have to be careful. The document must be well structured. place any text or image within <p> tags or <div> tags. The same rule for <input> tag and <label> tag, they have to placed within <p> tags.
Get use to check the validity of your website, so you will know how the codes should be.

0 comments:

Post a Comment