Home Web Front-end HTML Tutorial XHTML网页教程_HTML/Xhtml_网页制作

XHTML网页教程_HTML/Xhtml_网页制作

May 16, 2016 pm 04:45 PM
html xhtml xml use Can us Tutorial Browser Web page


本文主要是让初学者认识了解XHTML的一些基础知识,以及和HTML的一些区别,希望对初学者有帮助。
HTML语言是我们建立网页的工具,从它出现发展到现在,规范不断完善,功能越来越强。但是依然有缺陷和不足,人们仍在不断的改进它,使它更加便于控制和有弹性,以适应网络上日新月异的应用需求。2000年底,国际W3C(World Wide Web Consortium)组织公布发行了XHTML 1.0版本,XHTML和HTML,XML有什么不同,它增加了什么新功能,今天就让我们来初步认识一下XHTML。
XHTML 1.0是一种在HTML 4.0基础上优化和改进的的新语言,目的是基于XML应用。XHTML是一种增强了的HTML,它的可扩展性和灵活性将适应未来网络应用更多的需求。下面是W3C的HTML工作组主席Steven pemberton回答的关于XHTML的常见基础问题。
问:什么是XHTML?
答:XHTML是一种为适应XML而重新改造的HTML。当XML越来越成为一种趋势,就出现了这样一个问题:如果我们有了XML,我们是否依然需要HTML?为了回答这个问题,1998年5月我们在旧金山开了两天的工作会议,会议的结论是:需要。我们依然需要使用HTML。因为大量的人们已经习惯使用HTML来作为他们的设计语言,而且,已经有数以百万计的页面是采用HTML编写的。
问:为什么XHTML 1.0相对HTML 4.0独立发展?
答:并不是这样。XHTML恰恰就是HTML 4.0的重新组织,(确切的说它是HTML 4.01,是一个修正版本的HTML 4.0,只不过以XHTML 1.0命名发行。) 它们在XML里的解释会有一些必要的差别,但另一方面,它们依然非常相似,我们可以把XHTML的工作看作是HTML 4.0基础上的延续。
问:XHTML 1.0如何实现XML标准?
答:XHTML就是一种XML应用。它采用XML的DTD文件格式定义,并运行在支持XML的系统上。这里要感谢XML的Namespaces功能,浏览器制造商不需要再创造新的私有标签(tags),他们只需要在XHTML代码里包含XML代码片段,或者XML代码里包含XHTML代码片段。
问:XHTML 1.0最主要的优势是什么?
答:XML是web发展的趋势,所以人们急切的希望加入XML的潮流中。使用XHTML 1.0,只要你小心遵守一些简单规则,就可以设计出既适合XML系统,又适合当前大部分HTML浏览器的页面。这个意思就是说,你可以立刻设计使用XML,而不需要等到人们都使用支持XML的浏览器。这个指导方针可以使web平滑的过渡到XML。
另一个使用XHTML的优势是:它非常严密。当前网络上的HTML的糟糕情况让人震惊,早期的浏览器接受私有的HTML标签,所以人们在页面设计完毕后必须使用各种浏览器来检测页面,看是否兼容,往往会有许多莫名其妙的差异,人们不得不修改设计以便适应不同的浏览器。
用XML我们可以重新建立制度,浏览器制造商联合采用"严格的错误防御标准",如果XML代码不兼容,浏览器拒绝显示页面,这样设计工作在发布前必须修正每一个错误。
问:用XHTML,网页设计师会遇到和HTML一样的浏览器兼容性问题吗?
答:希望不会。"严格的错误防御标准"将帮助浏览器对代码作出相同的响应,XML的namespaces功能使你可以增加自己的新标签而不需要特别的浏览器支持。现在我们所需要得到保证的就是:所有浏览器开发商一致并且完全遵守我们制定的CSS。写信给你的浏览器制造商,告诉你需要的CSS规范,你甚至可以检测浏览器是否听从你的设计。
问:学习XHTML是否很困难?
答:一点也不!
问:谁可以采用XHTML 1.0设计?
答:因为XHTML非常简单易于实现,所以任何会用HTML的人都可以容易地使用XHTML。当使用XML浏览器的人们越来越多,更多的工作会被建议使用XML,那时侯也许都将使用XHTML。
问:什么时候XHTML网站会普及?
答:好问题。我已经看到一些使用XHTML建立的网站,甚至在XHTML 1.0发布以前。我相信它将会有一个大发展,因为它太容易了。
问:我们如何将现有的HTMl转换为XHTML?
答:非常简单,因为它们非常相似。在W3C(www.w3c.org)网站上有一个开放原代码(open-source)的软件叫HTML Tidy,可以帮助你直接转换。
问:XHTML未来会怎样?
答:XHTML1.0仅仅是这个新HTML语言的第一步。新版本将没有向下兼容老浏览器的约束,可以有更多的发展空间。
首先,我们将进行一次彻底的清理,删除HTML 4.0中不兼容的元素。
其次,我们将XHTML模块化,允许人们在XML应用中使用XHTML模块(比如表格),减少重复开发。同时也允许开发特别用途的设计,比如电话应用,只要属于XHTML的子集就可以保持兼容,人们可以创造他们自己的HTML。
最后,在解决需求方面,我们将开发更多的表单(Forms)功能,允许在客户端执行更多的检测,减少客户机--服务器之间的网络信息传输。总之,更多令人兴奋的功能将会被实现。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? How to correctly display the locally installed 'Jingnan Mai Round Body' on the web page? Apr 05, 2025 pm 10:33 PM

Using locally installed font files in web pages Recently, I downloaded a free font from the internet and successfully installed it into my system. Now...

How to achieve gap effect on the card and coupon layout with gradient background? How to achieve gap effect on the card and coupon layout with gradient background? Apr 05, 2025 am 07:48 AM

Realize the gap effect of card coupon layout. When designing card coupon layout, you often encounter the need to add gaps on card coupons, especially when the background is gradient...

Why does negative margins not take effect in some cases? How to solve this problem? Why does negative margins not take effect in some cases? How to solve this problem? Apr 05, 2025 pm 10:18 PM

Why do negative margins not take effect in some cases? During programming, negative margins in CSS (negative...

How to customize the resize symbol through CSS and make it uniform with the background color? How to customize the resize symbol through CSS and make it uniform with the background color? Apr 05, 2025 pm 02:30 PM

The method of customizing resize symbols in CSS is unified with background colors. In daily development, we often encounter situations where we need to customize user interface details, such as adjusting...

How to obtain real-time application and viewer data on the 58.com work page? How to obtain real-time application and viewer data on the 58.com work page? Apr 05, 2025 am 08:06 AM

How to obtain dynamic data of 58.com work page while crawling? When crawling a work page of 58.com using crawler tools, you may encounter this...

The style remains the same after PC page zooms: What are the possible solutions? The style remains the same after PC page zooms: What are the possible solutions? Apr 05, 2025 am 07:51 AM

The challenge of keeping the style of the page zoomed and the same after the page is zoomed in. Many developers will encounter a difficult problem when making PC pages: when the user zooms in or out of the browsing...

How to use CSS and Flexbox to implement responsive layout of images and text at different screen sizes? How to use CSS and Flexbox to implement responsive layout of images and text at different screen sizes? Apr 05, 2025 pm 06:06 PM

Implementing responsive layouts using CSS When we want to implement layout changes under different screen sizes in web design, CSS...

See all articles