HTML and CSS Reference
In-Depth Information
As you will see later in the chapter, most CSS properties are visual properties or can be applied to all media, but
there are many properties designed for a specific media type.
One of the major concepts of CSS is to separate HTML/XHTML content from appearance, in other words, to
distinguish style from structure. Another aim is centralization, which means providing full control over the styles of
multiple documents from a single location.
Although CSS is used primarily for styling (X)HTML web documents, it can also be applied to all kinds of XML
documents, for example XUL or SVG [1]. In SVG, many CSS properties are reused for styling, such as font properties,
text properties, and other visual properties. SVG also uses CSS features such as the CSS syntax, selectors, external
style sheets, cascading, inheritance, and at-rules, each of which will be described later in detail. Since SVG is an XML
application, internal CSS style sheets can be provided as CDATA sections (Listing 5-1).
Listing 5-1. Embedded CSS in SVG
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG August 1999//EN"
" " >
<![CDATA[ main { font-size: 14px; font-family: Georgia, serif; } ]]>
<text class="main">Here is my title</text>
CSS can even be used for mathematical notations with or without MathML, the markup language discussed in
Chapter 3, which is especially designed for publishing equations and mathematical symbols on the Web [2, 3].
Levels, Profiles, and Modules
The various versions of CSS are often referred as CSS levels . Each CSS level is based on the previous level and adds
new properties and features. The three most significant versions are CSS1, CSS 2.1, and CSS3.
Subsets of at least one level of CSS created for a particular device are called CSS profiles , such as the CSS Print
Profile [4], the CSS TV Profile [5], and the CSS Mobile Profile [6].
The specifications that form CSS3 are called CSS modules .
profiles are not equal to media types, which were introduced in CSS2.
The three major CSS versions are described in the following sections.
CSS Level 1, the first Cascading Style Sheet specification, was published in 1996. It is a W3C Recommendation, but
its development has been closed by W3C [7]. CSS1 introduced styles for font properties, element color, alignment,
tables, margin, border, padding, and positioning. CSS1 properties can be applied to uniquely identified elements or
element groups.
Search WWH ::

Custom Search