Professional Documents
Culture Documents
Style Sheets
LACUNY Web Management Roundtable
October 21, 2005
http://www.lehman.edu/provost/library/CSS/CSS.ppt
CSS Separate Style From
Structure of a Web Page
• Specify point size and font of text;
• Set margins within a web page;
• Create a distinctive style for individual web
pages or sets of web pages;
• Format style to one element of a web page or to a
numerous pages;
• Control color of different elements of a web
page;
• Etc.
• CSS rule
H3
{
Font-family: times new roman, 'serif';
Color: #800000;
Text-align: center;
}
TH {color: red;}.
• The Selector indicates the element to which the
rule is applied.
• The Declaration determines the property values
of a selector.
October 21, 2005 LACUNY Web Roundtable galina.letnikova@lehman.cuny.edu 5
Understanding Style Rules
• The Property specifies a characteristic, such as
color, font-family, position, and is followed by a
colon (:).
• The Value expresses specification of a property,
such as red for color, arial for font family, 12 pt
for font-size, and is followed by a semicolon (;).
Property Value
P {color: red;}
h1, h2, h3
{font-family: verdana, arial, 'sans serif'; color: #9933FF;
text-align: center;}
October 21, 2005 LACUNY Web Roundtable galina.letnikova@lehman.cuny.edu 8
Linking to an External Style
Sheet
• To link a Web page to an external style sheet a
<LINK> element should be added within
<HEAD> element of a document with the URL
to a style sheet. It tells the browser to find a
specified style sheet.
<Head>
<Title>Demo_1</Title>
<Style type=“text/css”>
<Link href=“style_1.css” Rel=“stylsheet”>
</Style>
</Head>
<Head>
<Title>Demo_1</Title>
<Style type=“text/css”>
<Link href=“style1.css” Rel=“stylsheet”>
</Style>
</Head>
CSS
A.nav:link { color: #990000; font-size: 12px; line-height: 14px; font-family:
arial, verdana, geneva, helvetica; text-decoration: none; }
A.nav:visited { color: #CC3333; font-size: 12px; line-height: 14px; font-
family: arial, verdana, geneva, helvetica; text-decoration: none; }
HTML
In the <Head> element
<link rel="stylesheet" href="Welcome_files/style" type="text/css">
In the <Body> element
<td align="center" height="25"><a class="nav"
href="http://mail.lehman.edu">Check your Lehman e-mail account</a>
</td>