Chapter 1
Overview of HTML and CSS
HTML (Hypertext Markup Language) is continually evolving. Within the past year and a half, two major innovations have extended HTML: an entirely new language for controlling style, and an object model for adding behavior and dynamism to documents. Dynamic HTML in Microsoft Internet Explorer 4.0 encompasses not only the object model for manipulating the document, but also many of the latest HTML and CSS (Cascading Style Sheets) recommendations and working drafts from the W3C (World Wide Web Consortium).
This chapter introduces some of the recent innovations to HTML and CSS supported by Internet Explorer 4.0. By combining existing HTML features and these new innovations with the Dynamic HTML object model, you can create interactive Web pages and Web applications. This chapter is not a comprehensive review of HTML and CSS. The effective use of HTML and CSS is a topic for an entire book. Rather, this chapter lets you, the Web author, to familiarize yourself with the latest work in these areas.
The following topics are covered in this chapter:
- New HTML featuresIE4 Demo
This section introduces some of the new features that were included in HTML 4.0.
- Cascading Style Sheets
The intent of SGML (Standard Generalized Markup Language), and therefore of HTML, is to separate content from presentation. This was not possible until the introduction of CSS, and tags such as <B> and <FONT> were incorporated in HTML because of the need to indicate how content was to be presented. These tags violate the fundamentals of a structured document by allowing the presentation to be embedded in the content.
This section introduces the CSS language and its relationship to the recent scripting additions. CSS is a static representation for adding style to a document but through the object model extensions that style can be dynamically changed. This allows, for example, the style of text to change based on the user's environment.
- Examining an HTML DTD
HTML is a structured language with a formal definition. This section discusses the importance of the DTD (document type definition) that defines HTML. The HTML DTD is the SGML declaration of the HTML language. A DTD defines the supported set of elements and their attributes and specifies whether an element can contain other elements. Unfortunately, the majority of pages on the Web violate the HTML DTD. With the addition of an object model that exposes the entire page to scripting, ensuring consistent and rational behavior by creating properly structured documents takes on greater importance. In this section, you'll learn how to read a DTD and use it to create valid HTML documents.