Web Development Learning Experience 1--what is html,xhtml

Source: Internet
Author: User
Tags empty

The web world found that now, there is a relatively perfect system, the basis of this system is html+css.

The original HTML not only marks the structure, it also marks how the Web page unfolds. As a result, there is a mixed situation of elements such as <p> and the representation of <center>. There was no CSS at that time.

Later, there is a special show of CSS, people found that the HTML should be cleaned and sorted, so that the HTML only represents the structure, and how to show the responsibility to the CSS completely. The idea received overwhelming support, so the HTML4.01 (also the latest version of the current edition) was developed at the end of 1999, the standard for large-scale cleaning of HTML, such as <font>, <center> The elements that represent the structure are swept out of the door. From then on, the HTML only represents the structure, while the CSS is responsible for the display.

However, things are not so simple, a large number of people are accustomed to using the old HTML for development, there are a large number of old-style web pages still need to be supported. In response to this situation, the HTML4.01 has developed 3 document types, namely, strict, transitional, and frame-oriented.

The so-called strict type, refers to completely conforms to the HTML4.01 standard document type, under this type, all expresses the element is not allowed to use, in addition, the element nesting rule and so on must conform to the HTML4.01 standard Strictly. Adding the following DOCTYPE type to the beginning of a document means that the document is strictly typed:

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >

The so-called transition type, as the name suggests, is a transitional type of document, the type of document does not exclude HTML legacy elements, under which you can use old-style elements, you can use the new elements. The nesting rules between elements are also not strict. Adding the following DOCTYPE type to the beginning of a document means that the document is a transitional type:

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >

A frame type is a type that allows a FRAME element to be included, that is, a <frameset> element. Frame-structured pages are now generally considered not a good page structure and are therefore rarely used. Adding the following DOCTYPE type to the beginning of a document means that the document is framed:

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 frameset//en"

"Http://www.w3.org/TR/html4/frameset.dtd" >

From the above description, we know that the page model recommended by the Web-site is a strict model, the reason for the existence of the transition model, is entirely a stopgap measure of necessity. Well-designed pages, HTML should only represent the structure, while CSS is responsible for the display of responsibility. And the structure of the HTML should also be well-formed (what is known as good construction next time).

I'm sure you've heard of XHTML, but maybe it's not clear what the relationship is between XHTML, HTML, XML, and here's the question.

First of all we have to understand what is XML, this I will not say more, you can refer to other information.

After we understand what XML is, we'll come back and discuss that question just now. The comparison between HTML and XML shows that they have an important common point, that is, the markup language, the difference being that HTML is not extensible, and XML is extensible. Now, let's consider a question like this.--html document is it an XML document? We found out it wasn't. The reason 1,xml is case-sensitive, while the HTML is case-insensitive, because the elements of the 2,xml are closed (that is, there are closing tags), and the empty elements of HTML are not closed (that is, there are no closing tags, such as <br>,); reason 3, The attribute value of an XML element must be enclosed in double quotes, which is not provided by HTML. So, people think that if the HTML document is an XML document, that would be nice, so that all operations against XML can be used to manipulate HTML. As a result, the XHTML1.0 version of the consortium was released in 2002, which transformed HTML4.01 into a subset of XML, which stipulates that all elements must be lowercase, that all empty elements must have an end tag, and that all attribute values must be enclosed in double quotes. Since then, the development of HTML has entered a new phase, and XHTML has become a subset of XML.

It is important to understand that XHTML is a subset of XML, and as we have said before, we should know that all operations against XML can be directed to XHTML, so it is possible to manipulate XHTML like Xpath,xslt,linq to XML.

Since HTML4.01 has 3 document types, XHTML1.0 also has 3 document types, no longer repeating them here.

By the way, the default document type for VS2008 is the XHTML1.0 transition type.

Next, we'll discuss XHTML's knowledge of block elements, inline elements, Div, and what is well-formed XHTML.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.