|
Emerging Technology
Fall Semester, 2004 CSS part 2 |
|
|---|---|---|
|
© 2004, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 06-Sep-04 |
CS 683 Emerging Technologies Fall Semester, 2004 Doc 3 CSS
Copyright ©, All rights reserved. 2004 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA. OpenContent ( http://www.opencontent.org/opl.shtml) license defines the copyright on this document.
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 2 |
Cascading Style Sheets, level 2 revision 1 CSS 2.1 Specification
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 3 |
|
aqua, |
black, |
blue, |
fuchsia, |
|
gray, |
green, |
lime, |
maroon, |
|
navy, |
olive, |
orange, |
purple, |
|
red, |
silver, |
teal, |
white, |
|
yellow |
|
|
|
em { color: #f00 } /* #rgb */
em { color: #ff0000 } /* #rrggbb */
em { color: rgb(255,0,0) }
em { color: rgb(100%, 0%, 0%) }
For color details see:
http://www.w3.org/TR/CSS21/syndata.html#value-def-color
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 4 |
h1 { margin: 0.5em } /* em */
h1 { margin: 1ex } /* ex */
p { font-size: 12px } /* px */
h1 { margin: 0.5in } /* inches */
h2 { line-height: 3cm } /* centimeters */
h3 { word-spacing: 4mm } /* millimeters */
h4 { font-size: 12pt } /* points */
h4 { font-size: 1pc } /* picas */
For more detail see:
http://www.w3.org/TR/CSS21/syndata.html#length-units
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 5 |
p { font-size: 10px }
p { line-height: 120% } /* 120% of 'font-size' */
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 6 |
A Border has
Details at:
http://www.w3.org/TR/CSS21/box.html#border-properties
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 7 |
Values
p
{
border-color: black;
border-top-width: 1pt;
border-right-width: 2pt;
border-bottom-width: thin;
border-left-width: thick;
border-style: solid;
}
p
{
border-color: black;
border-style: solid;
border-width: 1pt 2pt thin thick;
}
p
{
border-color: black;
border-width: 1pt;
border-style: solid;
}
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 8 |
Values
No border; the border width is zero.
Same as 'none', except in terms of of border conflict resolution for table elements.
The border is a series of dots.
The border is a series of short line segments.
The border is a single line segment.
The border is two solid lines. The sum of the two lines and the space between them equals the value of 'border-width'.
The border looks as though it were carved into the canvas.
The opposite of 'groove': the border looks as though it were coming out of the canvas.
The border makes the box look as though it were embedded in the canvas.
The opposite of 'inset': the border makes the box look as though it were coming out of the canvas.
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 9 |
p
{
border-color: black;
border-top-style: solid;
border-right-style: dotted;
border-bottom-style: double;
border-left-style: groove;
border-width: 1pt;
}
p
{
border-color: black;
border-width: 1pt;
border-style: solid dotted double groove;
}
p
{
border-color: black;
border-width: 1pt;
border-style: solid;
}
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 10 |
p { margin: 1.5pt 1em 2.3mm 2in; }
body { margin: 2em } /* all margins set to 2em */
body { margin: 1em 2em } /* top & bottom = 1em, right & left = 2em */
body { margin: 1em 2em 3em } /
* top=1em, right=2em, bottom=3em, left=2em */
body {
margin-top: 1em;
margin-right: 2em;
margin-bottom: 3em;
margin-left: 2em; /* copied from opposite side (right) */
For details see:
http://www.w3.org/TR/CSS21/box.html#margin-properties
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 11 |
|
'background-color', |
'background-image', |
|
'background-repeat', |
'background-attachment', |
|
'background-position', |
'background' |
p
{
margin: 1.5pt 1em 2.3mm 2in;
background-color: lime;
}
For details see:
http://www.w3.org/TR/CSS21/colors.html#q2
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 12 |
|
font-family |
font-style |
|
font-variant |
font-weight |
|
font-size |
|
Value: <family-name> | <generic-family> | inherit
<generic-family>
body { font-family: Gill, Helvetica, sans-serif }
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 13 |
Values: normal | small-caps | inherit
h3 { font-variant: small-caps }
em { font-style: oblique }
Values: normal | italic | oblique | inherit
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 14 |
Values
|
normal |
bold |
|
bolder |
lighter |
|
100 |
200 |
|
300 |
400 |
|
500 |
600 |
|
700 |
800 |
|
900 |
inherit |
400 = normal
700 = bold
p { font-weight: normal } /* 400 */
h1 { font-weight: 700 } /* bold */
strong { font-weight: bolder }
p { font-weight: lighter }
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 15 |
Value: <absolute-size> | <relative-size> | <length> | <percentage> | inherit
|
CSS absolute-size values |
xx-small |
x-small |
small |
medium |
large |
x-large |
xx-large |
|
|
scaling factor |
3/5 |
3/4 |
8/9 |
1 |
6/5 |
3/2 |
2/1 |
3/1 |
|
HTML headings |
h6 |
|
h5 |
h4 |
h3 |
h2 |
h1 |
|
|
HTML font sizes |
1 |
|
2 |
3 |
4 |
5 |
6 |
7 |
<relative-size> larger | smaller
p { font-size: 16px; }
@media print {
p { font-size: 12pt; }
}
blockquote { font-size: larger }
em { font-size: 150% }
em { font-size: 1.5em }
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 16 |
Affect visual presentation of characters, spaces, words, and paragraphs
For details see:
http://www.w3.org/TR/CSS21/text.html
Values: <length> | <percentage> | inherit
p { text-indent: 3em }
p.left { text-indent: -1in }
Values: left | right | center | justify | inherit
div.important { text-align: center }
Values: none | [ underline || overline || line-through || blink ] | inherit
a:visited,a:link { text-decoration: underline }
| CS 683 Fall 04 | Doc 3, CSS part 2 Slide # 17 |
Values:
Puts the first character of each word in uppercase; other characters are unaffected.
Puts all characters of each word in uppercase.
Puts all characters of each word in lowercase.
No capitalization effects.
Copyright ©, All rights reserved.
2004 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.