Professional Documents
Culture Documents
Lecture 2 3
Lecture 2 3
Lecture 2 3
Lecture 2
1
CSS
Web Programming – Fall 2010
Inline
<p style="color: sienna; margin-left: 20px">
This is a paragraph
</p>
Multiple
h3 { color: red; text-align: left; font-size: 8pt }
h3 { text-align: right; font-size: 20pt }
color: red; text-align: right; font-size: 20pt
Cascading Order
Web Programming – Fall 2010
Browser default
External style sheet
Internal style sheet (inside the <head>
tag)
Inline style (inside an HTML element)
Depth
Web Programming – Fall 2010
h1,h2,h3,h4,h5
{
color: green;
}
10
Id Selector
Web Programming – Fall 2010
11
Anchor pseudo-class
Web Programming – Fall 2010
@media screen
{
p.test
{
font-family:verdana,sans-serif;
font-size:14px
}
}
@media print {
p.test
{
font-family:times,serif;
font-size:10px
}
}
@media screen,print
{
p.test {font-weight:bold}
}
CSS Hacks
Web Programming – Fall 2010
<html>
<head><title>Test</title>
<!-- [if IE]> <link href=“ie_only.css” ….. > <![endif] -->
<!-- [if !IE]> <link href=“other.css” ….. > <![endif] -->
</head>
….
www.webdevout.net/css-hacks
14
IE Issues and Holly Hack
Web Programming – Fall 2010
15
Tips
Web Programming – Fall 2010