Ways to design reusable web sites with XHTML and CSS 1th/4 page _ Experience Exchange

Source: Internet
Author: User

The goal of the XHTML standard is to replace HTML. According to the consortium, "XHTML is the successor to HTML " (http://www.w3.org/MarkUp/).

XHTML has two main goals:

    • Creates a more distinct separation between the document structure and the representation.
    • An application that will reuse HTML as XML.

The advantage of using the XHTML standard is that the page is designed to be displayed and worked in exactly the same way in any modern browser, just once. For example, after a standard build, pages are displayed in the same way in Internet Explorer, Mozilla Firefox, Netscape Navigator, Opera, Camino, and Safari without doing any extra work. and XHTML standards make it easier for WEB sites to access devices such as smartphones and disabled computers.

Because the XHTML standard requires creating a more distinct separation between the document structure and the representation. Therefore, it is essential to use CSS style sheets. CSS in the Web page occupies a very important position, its use has been a hot topic of discussion. CSS is a shorthand for cascading style sheet, translated as "cascading style forms." The HTML4 standard was promulgated in 1997, and the first standard CSS1 on the stylesheet was published, after the CSS1 version, and the CSS2 version was released in May 1998.

The purpose of the CSS inventor is to remove the presentation element, that is, the content should be tagged based on what the content represents, and the style sheet should be used to beautify the content. This is consistent with the objective of XHTML's separation of document structures and representations (the B, I and IMG tags (as well as big, small, and TT) are eliminated in XHTML 2.0, and even the use of BR is not favoured, ready to be removed from future releases. The reason is that most of the tags are representation. Their sole purpose is to give the browser instructions on how their content should be displayed, but without providing information about what the content is. So they become the best partners. For more information on XHTML2.0, see: http://www-128.ibm.com/developerworks/cn/xml/x-wa-xhtml/index.html

CSS used to be used to define the attributes of a font, and now we will use it to control the display of the entire page in the new standard. However, we must do something different from the past to adapt to this new change, such as using div to lay out instead of tables, using structured, semantically marked, and so on. With the new approach, we can now easily design reusable CSS (used in multiple Web sites of the same style file) and a Web site that can be skinned (one site uses many different styles).

For example, see the Sichuan Provincial Construction Office information portal , the interface is switched to the upper right, as shown in Figure 1. For time reasons, XHTML and CSS checksums are not validated, but the principle is the same.

Figure 1: Interface style switching

Current 1/4 page 1234 Next read the full text
Related Article

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.