HTML and CSS Reference
In-Depth Information
HTML Versions
HTML has gone through several versions, each of which expands the capabilities
of the authoring language. To ensure that browsers can interpret each new version of
HTML, the World Wide Web Consortium (W3C) maintains HTML standards, or speci-
fications, which are publicly available on its Web site. HTML5 is the newest version of
HTML. HTML5 provides a more flexible approach to Web development. For instance,
with HTML5, you can combine lowercase, uppercase, or mixed-case lettering in your
tags and attributes. Despite the HTML5 lexibility, this topic will adhere to good coding
practices that would make it easy to convert to XHTML standards if they should one day
override HTML5. The coding practices to which the topic adheres are: using all lower-
case tags and attributes, enclosing all attribute values in quotation marks, closing all tags,
and nesting tags properly (see Table 1-3 on page HTML 13). Although HTML5 has
become very popular with Web developers, it is still being developed by the World Wide
Web Consortium. The challenge for Web developers, therefore, is to know which new
tags and attributes are supported by which browser. This topic utilizes HTML5 tags and
attributes that are currently supported by Internet Explorer. Additionally, we combine
HTML 4.01 tags and attributes with HTML5 to create all of the Web pages in the topic.
Despite the popularity of HTML5 and HTML 4.01, most browsers continue to support
HTML versions 3.2 and 2.0. As described later in this chapter, it is important to verify
that Web pages are displayed as intended in a variety of browsers during the testing phase
of development.
Cascading Style Sheets
This topic has taken a new direction by eliminating deprecated tags and attributes.
Deprecated tags and attributes are tags and attributes that are being phased out and
therefore no longer recommended in the latest W3C standard. Deprecated tags are
still used in many Web pages, however, so it is good to know their purpose from a
maintenance standpoint. In Appendix A, deprecated tags and attributes are highlighted
with an asterisk. In an effort to eliminate deprecated HTML tags, the projects utilize
Cascading Style Sheets (CSS) to alter the style (or look) of a Web page. Although HTML
allows Web developers to make changes to the structure, design, and content of a Web
page, it is limited in its ability to define the appearance, or style, across one or more Web
pages. Cascading Style Sheets ( CSS ) allow you to specify styles for various Web page
elements. A style is a rule that defines the appearance of a Web page element. A style
sheet is a series of rules that defines the style for a Web page or an entire Web site. With
a style sheet, you can alter the appearance of a Web page or pages by changing characteristics
such as font family, font size, margins, and link specifications, as well as visual elements
such as colors and borders. CSS is not used to add any content to your Web site; it just
makes your content look more stylish.
With CSS you can specify the style for an element within a single Web page or
throughout an entire Web site. For example, if you want all text paragraphs on a Web page
to be indented by five spaces, you can use a style sheet to handle the indenting, rather than
coding each paragraph with an indentation. And, if you decided you wanted to change the
indent to three spaces, you would change just one style sheet line rather than changing the
coding for each paragraph. So you can see that using CSS saves a lot of time and makes it
much easier to make style changes.
CSS is not HTML; it is a separate language used to enhance the display capabilities
of HTML. The World Wide Web Consortium, the same organization that defines HTML
standards, deines the speciications for CSS. This topic will provide information about CSS3,
the newest version of CSS that is currently being developed. We address the new features that
CSS3 brings to the world of Web development. Be forewarned that this is a moving target and
CSS, DOM, and XHTML
The w3.org Web site has
an extensive amount of
information and tutorials
about Cascading Style
Sheets (CSS), Document
Object Model (DOM), and
Extensible HTML (XHTML).
The standards suggested
in the W3C Web site are
the ones that most Web
developers follow.
 
Search WWH ::




Custom Search