2-XHTML_Tutorial

XHTML Tutorial from W3Schools

<!--[if !supportLists]-->1. <!--[endif]-->XHTML Tutorial

<!--[if !supportLists]-->2. <!--[endif]-->Quiz

<!--[if !supportLists]-->3. <!--[endif]-->References(same as HTML References)

<!--[if !supportLists]-->1. <!--[endif]-->XHTML Tutorial

1Introduction To XHTML

http://www.w3schools.com/xhtml/xhtml_intro.asp

XHTML stands for EXtensible HyperText Markup Language
XHTML is a stricter and cleaner version of HTML.

Learn the difference between HTML and XHTML
Convert HTML to XHTML

XHTML is HTML defined as an XML application.

W<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C" w:st="on">3C</chmetcnv> defines XHTML as the latest version of HTML. XHTML will gradually replace HTML.

XHTML is almost identical to HTML 4.01

All new browsers have support for XHTML.

A click on this symbol: <!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter" /> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0" /> <v:f eqn="sum @0 1 0" /> <v:f eqn="sum 0 0 @1" /> <v:f eqn="prod @2 1 2" /> <v:f eqn="prod @3 21600 pixelWidth" /> <v:f eqn="prod @3 21600 pixelHeight" /> <v:f eqn="sum @0 0 1" /> <v:f eqn="prod @6 1 2" /> <v:f eqn="prod @7 21600 pixelWidth" /> <v:f eqn="sum @8 21600 0" /> <v:f eqn="prod @7 21600 pixelHeight" /> <v:f eqn="sum @10 21600 0" /> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" /> <o:lock v:ext="edit" aspectratio="t" /> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" alt="Validate" style='width:66pt;height:23.25pt' o:button="t"> <v:imagedata src="file:///C:\DOCUME~1\dell\LOCALS~1\Temp\msohtml1\01\clip_image001.gif" o:href="http://www.w3schools.com/images/vxhtml.gif" /> </v:shape><![endif]--><!--[if !vml]--><!--[endif]-->validates the XHTML part of this page.

A click on this symbol: <!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75" alt="Validate" style='width:66pt; height:23.25pt' o:button="t"> <v:imagedata src="file:///C:\DOCUME~1\dell\LOCALS~1\Temp\msohtml1\01\clip_image002.gif" o:href="http://www.w3schools.com/images/vcss.gif" /> </v:shape><![endif]--><!--[if !vml]--><!--[endif]-->validates the CSS part of this page.

Explaining:

* Why you should use XHTML

* The syntax of XHTML

* How W3Schools was converted to XHTML

* XHTML validation

* XHTML modularization

2. XHTML - Why?

http://www.w3schools.com/xhtml/xhtml_why.asp

XHTML is a combination of HTML and XML (EXtensible Markup Language). (XML is more important for transferring data…)

3. Differences Between XHTML And HTML

http://www.w3schools.com/xhtml/xhtml_html.asp

http://www.w3schools.com/xhtml/xhtml_syntax.asp

You can prepare yourself for XHTML by starting to write strict HTML (XHTML is not very different from the HTML 4.01 standard.)
The Most Important Differences:

* XHTML elements must be properly nested

* XHTML elements must always be closed

* XHTML elements must be in lowercase

* XHTML documents must have one root element

XHTML Syntax:

Some More XHTML Syntax Rules:

* Attribute names must be in lower case

* Attribute values must be quoted

* Attribute minimization is forbidden
Here is a list of the minimized attributes in HTML and how they should be written in XHTML:

HTML

XHTML

compact

compact="compact"

checked

checked="checked"

declare

declare="declare"

readonly

readonly="readonly"

disabled

disabled="disabled"

selected

selected="selected"

defer

defer="defer"

ismap

ismap="ismap"

nohref

nohref="nohref"

noshade

noshade="noshade"

nowrap

nowrap="nowrap"

multiple

multiple="multiple"

noresize

noresize="noresize"

* The id attribute replaces the name attribute

* The XHTML DTD defines mandatory elements

4. XHTML DTD
http://www.w3schools.com/xhtml/xhtml_dtd.asp

<!DOCTYPE> Is Mandatory:
An XHTML document consists of three main parts:

* the DOCTYPE

* the Head

* the Body

The DOCTYPE declaration should always be the first line in an XHTML document.

There are currently 3 XHTML document types:

* STRICT

* TRANSITIONAL

* FRAMESET

The most common is the XHTML Transitional.

5. XHTML HowTo (Convert HTML To XHTML)
http://www.w3schools.com/xhtml/xhtml_howto.asp
The following steps were executed (in the order listed below):

A DOCTYPE Definition Was Added

Lower Case Tag And Attribute Names

All Attributes Were Quoted

Empty Tags: <hr> , <br> and <img>

The Web Site Was Validated

(Should we have used a converting tool? Well, we could have used TIDY. But we can modify it manually. )

6. XHTML Validation
http://www.w3schools.com/xhtml/xhtml_validate.asp
An XHTML document is validated against a Document Type Definition.

7. XHTML Modularization
http://www.w3schools.com/xhtml/xhtml_modules.asp
W<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="C" w:st="on">3C</chmetcnv> has split the definition of XHTML into 28 modules.

(XHTML Tags)

XHTML Standard Attributes
http://www.w3schools.com/xhtml/xhtml_standardattributes.asp

XHTML Event Attributes
http://www.w3schools.com/xhtml/xhtml_eventattributes.asp

8. You Have Learned XHTML, Now What? (XHTML Summary)

http://www.w3schools.com/xhtml/xhtml_summary.asp

The next step is to learn CSS and JavaScript.

<!--[if !supportLists]-->2. <!--[endif]-->Quiz
http://www.w3schools.com/xhtml/xhtml_quiz.asp

<!--[if !supportLists]-->3. <!--[endif]-->References(same as HTML References)

HTML的语法相同,只需要注意XHTMLHTML不同的地方即可。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值