Professional Documents
Culture Documents
Cascading style sheets are used to maintain a consistent look across a Web site—especially Web sites that contain
many pages.
Made up of a selector and a declaration that defines the style for one or more properties
selector Part of the style statement that identifies the page elements
declaration Part of the style statement that identifies how the elements should display
Includes at least one type of style, or property, to apply to the selected
element
style statement
o Properties include color; text-indent; border-width; font-style
o For each property, the declaration includes a related value—which
specifies the display parameters for that specific property
h1 {font-family: Garamond; First property value sets the h1 font family to Garamond
font-size: 32 pt} Second property value sets the font size to 32 point
(The browser will display all h1 headers in 32-point Garamond)
selector declaration
<style type=”text/css”>
<!--
p {text-indent: 8 pt} selector p defines the style for all paragraphs—indented 8 points
selector a used to indicate the link element
a {text-decoration: none; text-decoration: none changes the default to no line for links;
font-family: Verdana;
font-size: 14 pt; Changes the font, color and point size of the links
color:navy}
This link tag must be inserted within the <head> tags of each Web page
to which you want to apply the stylesheet
You can create several different variations for any one tag
You might utilize three different classes of paragraphs, and each one can have a different style
sheet declaration
You can name classes anything that you want, but be sure to use a period before the class
name in the style sheets rule
<style type=”text/css”>
<!-->
-->
</style>