Cascading Style Sheets and Dynamic HTMLby Jeff KozorisNetwork Notes #51 ISSN 1201-4338 Information Analysis and Standards National Library of Canada October 31, 1997
1. IntroductionHTML (Hypertext Markup Language) is by far the most common document format on the World Wide Web. HTML is a form of SGML (Standard Generalized Markup Language), which is primarily concerned with structure, rather than layout or presentation styles. Thus, though widely used, HTML does not support most of the page layout features found in desktop publishing applications. It does include tags that provide for some forms of presentation, such as tables, and tags to specify fonts and colours. However, these tags are bulky and require extensive coding. A major complaint against HTML is that it does not allow the precise positioning of text and images, as required in desktop publishing. Authors and publishers want greater control over layout so that they can create sophisticated publications that retain the same layout and look regardless of the configuration of a user's browser. Two developments, Cascading Style Sheets and dynamic HTML, have been designed to address these limitations of HTML.
2. Cascading Style Sheets (CSS)Cascading Style Sheets (CSS) address the problem of layout control, putting the power of desktop publishing into the hands of Web publishers. Authors can create pages that display precise margins, various font styles, measured white space around text and graphical elements, and other desktop publishing-like page formatting controls. 1 In addition to helping authors create the exact layout they want for a page, Cascading Style Sheets allow them to apply a universal look and feel over an entire Web site without the work of inserting new tags and templates into each Web page. Features and advantages of Cascading Style Sheets:
3. Dynamic HTMLDynamic HTML is a combination of Cascading Style Sheets and a scripting language (such as VisualBasic script or Javascript) that merges the actual HTML document with the style sheet. "Using Dynamic HTML, developers will be able to create a Web page that can respond dynamically to user-generated events, such as mouse clicks, by expanding an HTML table, changing the attributes of a font, or moving a graphic across a page. All of this can be done without going to the server or relying on plug-ins or Java applets." 2 3.1 Data bindingOne of the key features of dynamic HTML is that the browser does the processing of effects locally, putting less strain on the server and speeding up load time. A very powerful example of this feature is "data binding." Currently, when a user interacts with a database, data are pulled from a system, tagged on the fly with HTML, then send to the user. If a user wants a different view of the data -- for example, sorted by author or by date -- he or she must make another call to the server which sorts the data, reformats it in HTML, and resends the data to the user. With the data binding feature of dynamic HTML, all relevant data are sent to the user to be sorted, filtered, and modified repeatedly, without having to contact the server again.
3.2 FontsIn both desktop and Web publishing, the availability of fonts is a major issue. Currently, Web authors are restricted to using fonts that are commonly present on users' systems. 3 A feature of dynamic HTML is the ability to use virtually any font on a Web page without the need for end users to have it present locally. This feature allows a Web page to retain its intended look when a certain font is specified. The text will not revert to New Times Roman if the font is not present, as is currently the case with standard HTML. 4. Differences between Netscape and Microsoft version of CSS and dynamic HTMLNetscape Communicator 4.0 supports Level 1 version of CSS (CSS1) under the name "Javascript Accessible Style Sheets" (JASS), while limited CSS support is now available in Microsoft's Internet Explorer 3.0, to be known as "Dynamic HTML." Both the Netscape and Microsoft versions are recognized under the generic name of "dynamic HTML," with the lower case ‘d.' In addition, each company has its own definition of dynamic HTML. Microsoft defines DHTML as:
5. Examples of Dynamic HTML
Microsoft Measures Itself Against Netscape
Netscape Communicator Feature Demos
Dynamic HTML in Netscape Communicator
Overview of Microsoft's Dynamic HTML
W3C Cascading Style Sheets, Level 1 Syntax
W3C Positioning HTML Elements Syntax for Layers 1 Microsoft. "Cascading Style Sheets-Adding Style to HTML" 2 Levitt, J. "Rift Over HTML's Dynamics," Information Week, April 7, Issue 625 3 Netscape. "New Dynamic HTML." 4 Zelnick, N. "Client: Dynamic HTML Battle Brewing," Web Week, April 21, 1997, vol. 3, issue 11, p.25. 5 Ibid. 6 Taylor, A. "The Evolution of Style Sheets."
Copyright. The National Library of Canada. (Revised: 1997-12-10). |