CSS2
CSS2
CONTENTS{
1. What is CSS?
1.
2.
2.
3.
4.
5.
6.
Syntax
Cascading Order
Examples of Properties
Limitations
CSS variations
{WHAT IS CSS?
Webpage
Structure
Styleformatting
(X)HTML
CSS
SYNTAX
CSS
{ BASIC SYNTAX
Made up of three parts:
selector {property: value}
{ SYNTAX
If the value is multiple words, put quotes around the
value
{ GROUPING
h1,h2,h3,h4,h5,h6
{
color: green
}
This is header h1
This is header h2
This is header h3
This is header h4
{ TEXT COLOR
<html><head>
<style type="text/css">
h1 {color: green}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
</style>
</head>
<body>
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<p>This is a
paragraph</p>
</body>
</html>
This is header 1
This is header 2
This is a paragraph
{CASCADING ORDER
1. Browser default
2. External style sheet
4. Inline style
<head>
<link
rel="stylesheet"
type="text/css"
href="mystyle.css"
/>
</head>
Keeping
all your styles in an external document is
</HTML>
simpler
<head>
<style type="text/css">
hr {color: sienna}
p {margin-left: 20px}
body {background-image:
url("images/back40.gif")}
</style>
</head>
EXAMPLES
CSS PROPERTIES & VALUES
{ BACKGROUND:
Control over the
background color
of an element
set an image as the
background,
repeat a
background image
background-color
color-rgb
color-hex
color-name
background-image
url(URL)
none
background-repeat
repeat
repeat-x
repeat-y
no-repeat
{TEXT:
color
direction
ltr
rtl
word spacing
normal
length
text-decoration
none
underline
overline
line-through
blink
text-align
left
right
center
justify
{FONT:
font-family
family-name
generic-family
font-size
xx-small
x-small
small
/etc./
font-weigh
normal
bold
bolder
lighter
100
{DIMENSION
{LIST:
<head>
<style type="text/css">
ul
{
list-style-image: url('arrow.gif')
}
</style>
</head>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
</body>
CSS
VARIATIONS, LIMITATIONS
WHY CSS?
Advantages to Workflow
Cost Savings
You WILL Be Cooler
ADVANTAGES OF CSS
Workflow
Faster downloads
Streamlined site maintenance
Global control of design attributes
Precise control (Advanced)
Positioning
Fluid layouts
IMPLEMENTATIONS
Apply to HTML pages
Apply to dynamic data
Format or style XML
{CSS LIMITATIONS
Some noted disadvantages of using "pure" CSS
include