Write a cross-browser DHTML application. You can go to www.dicp.ac.cn to see what this applies to both IE and NS.

Source: Internet
Author: User
This article describes the differences between IE and navigator two browsers on the implementation of DHTML standards, especially how to write DHTML programs that run in navigator.
DHTML (Dynamic HTML) is a new specification proposed by the consortium, which makes a lot of extensions to the original HTML, and combines JavaScript to make the static HTML page have many dynamic effects, such as the expansion and collection of menus, the dynamic change of the appearance of page elements, etc. IE more than 4.0, Navigator more than 4.0 of the version supports this standard. However, different browser manufacturers have done a different degree of expansion. In the case of the most popular IE and NS, the implementation of IE is closer to the scheme of the consortium, and NS, to tell the truth, differs greatly from the scheme of the consortium, and it is not fully implemented, or even another scheme. The author in the first to understand the DHTML, according to the book to write a few small programs, ie on a try on the pass, and in the NS can be said to take pains to find solutions gradually. Since few books on the NS-DHTML implementation are available on the market (probably NS is not conforming to the standard), and the real business site should at least support both IE and NS Two main browsers, I would like to write some of my experience to share with you, so that we do not have to walk the detour I have walked. For the same part of the implementation of the two, this article makes a brief introduction, if you are interested can refer to the books or online resources.
DHTML actually consists of three parts: CSS (Cascade style Sheet, cascading style sheet), layer (Layer), and JavaScript.
The so-called CSS, conceptually similar to classes in C + +, where the element's appearance style, such as font, color, size, and so on, is specified in the class definition, any HTML element on the page automatically owns the attribute of the class if it is assigned to this class, and can also define a style for some HTML element. All of these elements in the page have the same appearance. If such a style definition exists in a separate. css file (as in C + +, where the class definition exists in the. h file), and then included in the page, all pages of a Web site have the same appearance. IE and NS for CSS implementation is basically the same, this is no longer described in detail.
The difference between the two is mainly embodied in the realization of the layer. The so-called layer, is a page on the area, which can contain any HTML elements, by changing the properties of the layer, the elements can then appear, disappear, change, move, and so on.
In IE, layers rely on <DIV></DIV> and <SPAN></SPAN> to achieve the same, usually <DIV> for larger layer,<span> for smaller layers, and <DIV> after the implementation of the layer plus a carriage return line, and <SPAN> not add. Its syntax is as follows (the two are the same):
<div id=layername style= "style definition" >layer content</div> or
<div id=layername class= "classname" >layer content</div>

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.