HTML and CSS Reference
In-Depth Information
4
What is CSS?
CSS, short for cascading style sheets, is the look-and-feel for HTML content. With CSS, you
can change how text, images, and links appear quickly and easily, on a single web page or
across and entire site — and what's more, the content's appearance can change based on the
medium presenting it. CSS is a powerful technology, tightly intertwined with HTML in the
building of modern websites. In this lesson, you learn the basics of CSS, including key con-
cepts, where to store your CSS rules, and how to work with primary selectors.
undersTandin
G cascadinG sTyLe sHeeTs
T
Tandin
Before CSS gained popularity, HTML pages were styled with tag attributes. For example, if
you wanted to make a particular heading red, your tag would look like this:
<h1 color=”red”>Listen Up!</h1>
The problem with this approach is that the styling of the content is very tightly tied to the con-
tent itself. Though changing a single tag is easy enough, what if your design called for all <h1>
tags to be red? If your color scheme changed so that every heading needed to be blue, you'd
have to update every tag, one at a time. CSS provides a presentation layer independent of the
content where you can easily make global formatting changes. This presentation layer brings
numerous benefits, including:
Ease of modification:➤➤
With CSS, you can style all the <h1 > tags — or any other tags or
custom selected content — in an entire site by changing values in one place.
Advanced design options:
Current CSS implementations enable rich background elements,
pixel-perfect positioning, and robust padding and margin possibilities. The next genera-
tion of CSS, much of which is available today in modern browsers, extends the designer's
palette with rounded corners, drop shadows, and gradients, among many other features.
Search WWH ::




Custom Search