CSS
CSS
pseudo-classes
Rules of thumb:
Use external style sheets to define site-wide style
Prefer style sheets (either external or embedded)
to style attributes
XML special characters
Must use references in embedded style sheets and
style attribute
Must not use references in external style sheets
Property values:
Specified: value contained in declaration
Absolute: value can be determined without reference to
context (e.g., 2cm)
Relative: value depends on context (e.g., larger)
character cell
(content area)
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey
C. Jacksons slides
CSS Font Properties
A font is a mapping from code points to glyphs
glyphs do not necessary stay inside cells!
generic
generic
fonts are
system-
specific
Computed value
of font-size
property
Inheritance of line-height:
Specified value if normal or unit-less number
Computed value otherwise
background-color
Specifies background color for content, padding,
and border areas
Margin area is always transparent
Not inherited; initial value transparent
background-image
Specifies (using url() function) image that will be
tiled over an element
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey
C. Jacksons slides
Backgrounds
<body style="background-image:url('CucumberFlowerPot.png')">
(html)
Block
elements
only
div d4
Top edges of
block boxes are
in document order
Heights
based on
content
initial
value of
vertical-
align
elements
Primary values are auto (initial value) or CSS length
Relative positioning
Specifying positive value for right property of
relatively positioned box moves it to left
<span style="background-color:red">
</span><span class="right">Red</span>
span
containing
text moves
left Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey
C. Jacksons slides
Beyond Normal Flow
Relative positioning
Specifying negative value for left property
also moves box to left
<span style="background-color:red">
</span><span class="right">Red</span>
same
effect as
before
Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey
C. Jacksons slides
Beyond Normal Flow
Float positioning
Specify value for float property
Float positioning
Specify value for float property
Absolute positioning
Specify location for corner of box relative to
positioned containing block
p elements are positioned (but dont move!)
margin area
padding area
containing This second paragraph has a
block note.
Absolute positioning
Specify location for edges of box relative to
positioned containing block
Absolute positioning
10em padding top
edge
padding left
edge
Absolute positioning
8em
Second absolutely
positioned box
obscures first