Understanding CSS-
CSS stands for Cascading Style Sheets. Its job is to
control the presentation of a web page document, written in (x)HTML.
The idea is that your web document, written in (x)HTML, contains the
content and structure of your page, and then you apply the CSS to
give the page color and layout, keeping content separate from
design.
Have you ever thought about what a web page is? I mean, what it
really is? Some people think of a web page as a visual medium, an
aesthetically pleasing experience which may or may not contain
information that’s of interest to the viewer. Other people think of
a web page as a document that may be presented to readers in an
aesthetically pleasing way. From a technical point of view, the
document interpretation is more appropriate.
When we examine the elements of its construction, a web document can
consist of up to three layers: content, presentation, and behavior.
The content layer is always present. It comprises the information the author
wishes to convey to his or her audience, and is embedded within HTML or XHTML
markup that defines its structure and semantics. Most of the content on the Web
today is text, but content can also be provided through images, animations,
sound, video, and whatever else an author wants to publish.
The presentation layer defines how the content will appear to a human being who
accesses the document in one way or another. The conventional way to view a web
page is with a regular web browser, of course, but that’s only one of many
possible access methods. For example, content can also be converted to synthetic
speech for users who have impaired vision or reading difficulties.
The behavior layer involves real-time user interaction with the document. This
task is normally handled by JavaScript. The interaction can be anything from a
trivial validation that ensures a required field is filled in before an order
form can be submitted, to sophisticated web applications that work much like
ordinary desktop programs.It’s possible to embed all three layers within the
same document, but keeping them separate gives us one valuable
advantage: we can modify or replace any of the layers without having
to change the others.
Cascading Style Sheets, or CSS, is the recommended way to control
the presentation layer in a web document. The main advantage of CSS
over presentational HTML markup is that the styling can be kept
entirely separate from the content. For example, it’s possible to
store all the presentational styles for a 10,000-page web site in a
single CSS file. CSS also provides far better control over
presentation than do presentational element types in HTML.
|