Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Full day workshop: For a beautiful web

Andy Clarke
November 20, 2007

Full day workshop: For a beautiful web

Workshop originally presented by Andy Clarke during 2007–2008

Andy Clarke

November 20, 2007
Tweet

More Decks by Andy Clarke

Other Decks in Design

Transcript

  1. Workshop originally presented by Andy Clarke during 2007–2008 For a

    beautiful web Andy Clarke is a digital designer, speaker, and writer whose designs have helped companies around the world to increase their sales pipeline and revenue, and charities to increase donations. He founded Stuff & Nonsense and has consulted and designed for clients including Disney Store UK, Fairfax Media, Home Office (UK), Greenpeace, ISO, SAP, STV, SunLife, WIPO, and WWF. He works on creative website and digital product designs and provides ongoing creative direction. He coaches agencies and mentors designers on dealing with clients, and delivering creative projects. If you’re looking to design better digital products and websites, develop a design system or style guide, or want to understand how design can help your business, you should talk to him. Stuff & Nonsense Ltd. Eversleigh, Lon Capel, Gwaenysgor, Flintshire, LL18 6EJ, UK For work enquiries go to stuffandnonsense.co.uk or call +44 (0)1745 851848
  2. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P R O G R E S S

    I V E 
 E N H A N C E M E N T Applying
progressive
enhancement
across
technologies: ‐ CSS
for
visual
styling ‐ JavaScript
and
the
DOM
for
behavior ‐ AJAX
and
related
sets
of
technologies
  3. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P R O G R E S S

    I V E 
 E N H A N C E M E N T Applying
progressive
enhancement
across
technologies: ‐ CSS
for
visual
styling ‐ JavaScript
and
the
DOM
for
behavior ‐ AJAX
and
related
sets
of
technologies
  4. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P R O G R E S S

    I V E 
 E N H A N C E M E N T Applying
progressive
enhancement
across
technologies: ‐ CSS
for
visual
styling ‐ JavaScript
and
the
DOM
for
behavior ‐ AJAX
and
related
sets
of
technologies
  5. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE G R A D E D 
 B

    R O W S E R 
 S U P P O R T “Support
does
not
mean
that
everybody
gets
the
same
 thing.
Expecting
two
users
using
different
browser
 software
to
have
an
identical
experience
fails
to
embrace
 or
acknowledge
the
heterogeneous
essence
of
the
web.” NATE
KOECHLEY DEVELOPER.YAHOO.COM/YUI/ARTICLES/GBS/GBS.HTML
  6. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE M E A N I N G F

    U L 
 M A R K U P <hx>
=
heading <p>
=
paragraph <ul>
=
unordered
list <ol>
=
ordered
list <dl>
=
definition
list
(name/value
pairs) <blockquote>
=
block
quotation
  7. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE F O R G O T T E

    N 
 H T M L 
 E L E M E N T S <del>
=
deleted
text <ins>
=
inserted
text <kbd>
=
computer
or
programming
related <q>
=
inline
quotations
 <cite>
=
citation
URLs
  8. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE S E M A N T I C

    
 W E B ‐ Semantics
for
machines
first,
people
second ‐ Access
to
multiple
sources
and
global
sharing
of
data ‐ RDF
(Resource
Description
Format)
 ‐ OWL
(Web
Ontology
Language) ‐ Implementations,
applications
and
user
agents
are
years
away
 ‐ Relies
on
emerging
technologies
  9. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE H C A R D For
marking
up
contact
information
for
people
and
 organisations H

    C A L E N D A R For
marking
up
information
about
events
such
as
 meetings,
conferences
and
concerts H R E V I E W For
marking
up
reviews
including
products
and
events
 W H AT 
 A R E 
 M I C R O F O R M AT S ?
  10. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE H C A R D For
marking
up
contact
information
for
people
and
 organisations H

    C A L E N D A R For
marking
up
information
about
events
such
as
 meetings,
conferences
and
concerts H R E V I E W For
marking
up
reviews
including
products
and
events
 W H AT 
 A R E 
 M I C R O F O R M AT S ?
  11. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE H C A R D For
marking
up
contact
information
for
people
and
 organisations H

    C A L E N D A R For
marking
up
information
about
events
such
as
 meetings,
conferences
and
concerts H R E V I E W For
marking
up
reviews
including
products
and
events
 W H AT 
 A R E 
 M I C R O F O R M AT S ?
  12. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P U B L I S H E

    R S 
 U S I N G 
 M I C R O F O R M AT S C O R K D 
 (corkd.com) Publishes
wine
reviews
using
hReview,
profiles
using
 hCard
and
relationships
using
XFN F L I C K R 
 (flickr.com) Geotagging
of
photos,
publishes
profiles
using
hCard L A S T. F M 
 (last.fm) Publishes
concert
information
using
hCalendar U P C O M I N G 
 (upcoming.org) Publishes
event
information
using
hCalendar
and
 profiles
using
hCard
  13. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P U B L I S H E

    R S 
 U S I N G 
 M I C R O F O R M AT S C O R K D 
 (corkd.com) Publishes
wine
reviews
using
hReview,
profiles
using
 hCard
and
relationships
using
XFN F L I C K R 
 (flickr.com) Geotagging
of
photos,
publishes
profiles
using
hCard L A S T. F M 
 (last.fm) Publishes
concert
information
using
hCalendar U P C O M I N G 
 (upcoming.org) Publishes
event
information
using
hCalendar
and
 profiles
using
hCard
  14. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P U B L I S H E

    R S 
 U S I N G 
 M I C R O F O R M AT S C O R K D 
 (corkd.com) Publishes
wine
reviews
using
hReview,
profiles
using
 hCard
and
relationships
using
XFN F L I C K R 
 (flickr.com) Geotagging
of
photos,
publishes
profiles
using
hCard L A S T. F M 
 (last.fm) Publishes
concert
information
using
hCalendar U P C O M I N G 
 (upcoming.org) Publishes
event
information
using
hCalendar
and
 profiles
using
hCard
  15. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE P U B L I S H E

    R S 
 U S I N G 
 M I C R O F O R M AT S C O R K D 
 (corkd.com) Publishes
wine
reviews
using
hReview,
profiles
using
 hCard
and
relationships
using
XFN F L I C K R 
 (flickr.com) Geotagging
of
photos,
publishes
profiles
using
hCard L A S T. F M 
 (last.fm) Publishes
concert
information
using
hCalendar U P C O M I N G 
 (upcoming.org) Publishes
event
information
using
hCalendar
and
 profiles
using
hCard
  16. M I C R O F O R M AT

    S : 
 V C A R D A
vCard
in
Apple’s
Address
Book
application
  17. M I C R O F O R M AT

    S : 
 H C A R D <p
class="vcard"> <span
class="fn">Malarkey</span>'s
a
Modern
kinda
guy
 who
loves
to
annoy
his
neighbours
in
 <span
class="locality">Gwaenysgor</span>
with
his
 collection
of
sixties
Mod
and
ska
classics.
Since
 signing
to
<span
class="org">Stuff
and
Nonsense
 Records</span>,
Malarkey
can
be
reached
by
 <a
class="email"
href="#">email</a>
or
by
phone
on
 <span
class="tel">+44
(0)1745
851848</span>. </p>
  18. M I C R O F O R M AT

    S : 
 H R E V I E W <h4
class="summary">Making
Ska
accessible <abbr
title="5"
class="rating"><img
src="5.png"
alt="5"
/></abbr> </h4> <h5
class="vevent"> <a
class="url"
href="#"> <span
class="summary">Live
at
MEN
Arena</span>
on
 <abbr
class="dtstart"
title="20070923">September
23th</abbr></a> </h5> <p>Helpful?

 <a
href="#"
rev="vote‐for">Yes</a>
|
 <a
href="#"
rev="vote‐against">No</a>
|
 <a
href="#"
rel="self
bookmark">Bookmark</a> </p>
  19. M I C R O F O R M AT

    S : 
 AT O M Stomping
Robots What
is
ska? Ska
combines
elements
of
Caribbean
mento
and
calypso
 with
American
jazz
and
rhythm
and
blues.
It
is
 characterised
by
a
walking
bass
line,
accented
guitar,
 or
piano
rhythms
on
the
offbeat,
and
in
some
cases,
 jazz‐like
horn
riffs. Jina
Bee
  20. M I C R O F O R M AT

    S : 
 AT O M <h1>Stomping
Robots</h1> <h2>What
is
ska?</h2> <p>Ska
combines
elements
of
Caribbean
mento
and
 calypso
with
American
jazz
and
rhythm
and
blues. It
is
characterised
by
a
walking
bass
line,
accented
 guitar,
or
piano
rhythms
on
the
offbeat,
and
in
some
 cases,
jazz‐like
horn
riffs.</p> <p>Jina
Bee</p>
  21. M I C R O F O R M AT

    S : 
 AT O M <div
class="hentry"> <h1>Stomping
Robots</h1> <h2
class="entry‐title">What
is
ska?</h2> <div
class="entry‐content">
 <p><span
class="entry‐summary">Ska
combines
elements
 of
Caribbean
mento
and
calypso
with
American
jazz
and
 rhythm
and
blues.</span>
It
is
characterised
by
a
 walking
bass
line,
accented
guitar,
or
piano
rhythms
 on
the
offbeat,
and
in
some
cases,
jazz‐like
horn
 riffs.</p> </div> <address
class="vcard
author"> <a
href="#"
class="fn
url">Jina
Bee</a> </address> </div>
  22. M I C R O F O R M AT

    S : 
 AT O M <p> <abbr
class="updated
published"
 title="20070921">September
21st
2007</abbr>
|
 <a
href="#"
rel="bookmark">Bookmark</a> </p> 
 <ul> <li><a
href="/music"
rel="tag">Music</a></li> <li><a
href="/history"
rel="tag">History</a></li> <li><a
href="/ska"
rel="tag">Ska</a></li> </ul>
  23. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 S E L E

    C T O R S ‐ Element
selectors

(
p
{
/*
rules
*/

}

) ‐ Class
selectors

(
.vcard
{
/*
rules
*/

}

) ‐ ID
selectors

(
#content
{
/*
rules
*/
}

) ‐ Pseudo‐class
selectors
(
a:link
{
/*
rules
*/

}

) ‐ Child
selectors
(
div
>
a
{
/*
rules
*/

}

) ‐ Adjacent
selectors
(
h2
+
p
{
/*
rules
*/

}

) ‐ Attribute
selectors
(
div[class="vcard"]
{
/*
rules
*/

}

) ‐ Pseudo‐elements
(
li:last‐child
{
/*
rules
*/

}

)
  24. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 S E L E

    C T O R S ‐ Element
selectors

(
p
{
/*
rules
*/

}

) ‐ Class
selectors

(
.vcard
{
/*
rules
*/

}

) ‐ ID
selectors

(
#content
{
/*
rules
*/
}

) ‐ Pseudo‐class
selectors
(
a:link
{
/*
rules
*/

}

) ‐ Child
selectors
(
div
>
a
{
/*
rules
*/

}

) ‐ Adjacent
selectors
(
h2
+
p
{
/*
rules
*/

}

) ‐ Attribute
selectors
(
div[class="vcard"]
{
/*
rules
*/

}

) ‐ Pseudo‐elements
(
li:last‐child
{
/*
rules
*/

}

)
  25. C H I L D 
 S E L E

    C T O R S <li> <h3>Live
at
Wembley
Arena</h3> <h4><img
src="5.png"
alt="5"
/></h4> <p>Reviewed
on
August
1st
2007</p> <h5>Live
at
Wembley
Arena
on
September
23th</h5> <img
src="jeffrey.jpg"
alt=""
/> <p>The
Nonsense
Robots
did
an
excellent
job
of
 mixing
ska
with
some
funky
reggae
beats.</p> </li> li
>
img
{
float
:
left;
}
  26. A D J A C E N T 
 S

    E L E C T O R S <li>
 <h3>Live
at
Wembley
Arena</h3> <h4><img
src="5.png"
alt="5"
/></h4> <p>Reviewed
on
August
1st
2007</p> <blockquote> <h5>Live
at
Wembley
Arena
on
September
23th</h5> <img
src="jeffrey.jpg"
alt=""
/> <p>The
Nonsense
Robots
did
an
excellent
job
of
 mixing
ska
with
some
funky
reggae
beats.</p> </blockquote> </li> h4
+
p
{
padding‐top
:
0;
}
  27. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S E L E C T O R S Style
an
element
either
based
 on
whether
an
element
has
an
 attribute
name
such
as
href
or
 based
on
the
attribute
value. img[alt] a[title] li[class="vcard"] div[id="content_main"]
  28. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S E L E C T O R S Style
an
element
either
based
 on
whether
an
element
has
an
 attribute
name
such
as
href
or
 based
on
the
attribute
value. img[alt] a[title] li[class="vcard"] div[id="content_main"]
  29. AT T R I B U T E 
 S

    E L E C T O R S <div
id="siteinfo"> <a
href="#thenonsenserobots‐com"
rel="self">Back
to
top</a> </div> #siteinfo
a[rel="self"]
{
 display
:
block;
 width
:
97px;
 height
:
72px;
 position
:
absolute;
 top
:
‐1px;
 right
:
15px;
 background
:
url(top.png)
no‐repeat;
 text‐indent
:
‐9999px;
}
  30. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S E L E C T O R S Style
an
element
either
based
 on
whether
an
element
has
an
 attribute
name
such
as
href
or
 based
on
the
attribute
value. img[alt] a[title] li[class="vcard"] div[id="content_main"]
  31. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S E L E C T O R S Style
an
element
either
based
 on
whether
an
element
has
an
 attribute
name
such
as
href
or
 based
on
the
attribute
value. img[alt] a[title] li[class="vcard"] div[id="content_main"]
  32. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S E L E C T O R S Style
an
element
either
based
 on
whether
an
element
has
an
 attribute
name
such
as
href
or
 based
on
the
attribute
value. img[alt] a[title] li[class="vcard"] div[id="content_main"]
  33. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 2 . 1 


    S P E C I F I C I T Y Example Style
in
document
 (inline
style) #
of
ID
selectors #
of
class
selectors #
of
Element
(type)
 selectors li 0 0 0 1 li.vcard 0 0 1 1 #content
li.vcard 0 1 1 1
  34. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE AT T R I B U T E

    
 S U B ‐ S T R I N G 
 S E L E C T O R S E[foo~="bar"] an
E
element
whose
"foo"
attribute
value
is
a
list
 of
space‐separated
values,
one
of
which
is
exactly
 equal
to
"bar" E[foo^="bar"] an
E
element
whose
"foo"
attribute
value
begins
 exactly
with
the
string
"bar" E[foo$="bar"] an
E
element
whose
"foo"
attribute
value
ends
 exactly
with
the
string
"bar" E[foo*="bar"] an
E
element
whose
"foo"
attribute
value
contains
 the
substring
"bar"
  35. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S
  36. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S <li> <h3>Sushi
Ska</h3> <h4>The
most
played
album
on
my
iPod</h4> <blockquote> <p>Sushi
Ska
is
a
unique
collection
of
Jamaican
influenced
ska.
 There
are
few
collections
of
ska
that
include
a
good
cross
 section
of
the
earliest
ska
classics
from
Jamaica
in
the
Sixties
 in
the
same
collection
as
music
of
the
Great
Ska
Revival
in
the
 United
Kingdom
in
the
Eighties.</p> </blockquote> <p><a
href="http://www.tantek.com/reviews/">Bookmark</a></p> </li>
  37. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S <li> <h3>Sushi
Ska</h3> <h4>The
most
played
album
on
my
iPod</h4> <blockquote> <p>Sushi
Ska
is
a
unique
collection
of
Jamaican
influenced
ska.
 There
are
few
collections
of
ska
that
include
a
good
cross
 section
of
the
earliest
ska
classics
from
Jamaica
in
the
Sixties
 in
the
same
collection
as
music
of
the
Great
Ska
Revival
in
the
 United
Kingdom
in
the
Eighties.</p> </blockquote> <p><a
href="http://www.tantek.com/reviews/">Bookmark</a></p> </li>
  38. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S <a
href="http://www.tantek.com/reviews/">Bookmark</a> ul
>
li
{
position
:
relative;
} li
>
h3,
li
>
h4,
li
>
blockquote

{
margin‐left
:
100px;
} a[href^="http://www.tantek.com"]:before
{
 content
:
url(tantek.png); position
:
absolute; top
:
0; left
:
0; }
  39. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S
  40. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S <a
href="http://www.tantek.com/reviews/">Bookmark</a> ul
>
li
{
position
:
relative;
} li
>
h3,
li
>
h4,
li
>
blockquote

{
margin‐left
:
100px;
} a[href^="http://www.tantek.com"]:before
{
 content
:
url(tantek.png); position
:
absolute; top
:
0; left
:
0; }
  41. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S <a
href="http://www.tantek.com/reviews/">Bookmark</a> ul
>
li
{
position
:
relative;
} li
>
h3,
li
>
h4,
li
>
blockquote

{
margin‐left
:
100px;
} a[href^="http://www.tantek.com"]:before
{
 content
:
url(tantek.png); position
:
absolute; top
:
0; left
:
0; }
  42. AT T R I B U T E 
 S

    U B ‐ S T R I N G 
 S E L E C T O R S
  43. P S E U D O 
 E L E

    M E N T S <ul> <li><strong>Availability:</strong>
In
stock</li> <li><strong>Price:</strong>
&pound;9.99</li> </ul>
  44. P S E U D O 
 E L E

    M E N T S #content
ul
li
{
display
:
inline;
padding
:
0
10px;
 border‐right
:
1px
solid
#333;
} #content
ul
li:last‐child
{
padding‐right
:
0;
 border‐right‐width
:
0;
}
  45. P S E U D O 
 E L E

    M E N T S p:first‐line
{
 font‐size
:
110%;
 font‐weight
:
bold;
 }
  46. P S E U D O 
 E L E

    M E N T S p:first‐line
{
 font‐size
:
110%;
 font‐weight
:
bold;
 }
  47. P S E U D O 
 E L E

    M E N T S p:first‐line
{
 font‐size
:
110%;
 font‐weight
:
bold;
 }
  48. P S E U D O 
 E L E

    M E N T S p:first‐letter
{
 font‐size
:
400%;
 font‐weight
:
bold;
 }
  49. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C O M B I N E D

    
 S E L E C T O R S id
+
child #nav‐main
>
li
{
/*
rules
*/

} descendent
+
class
+
adjacent .nav
ul
li
+
li
{
/*
rules
*/

} id
+
descendent
+
element
+
pseudo
class #nav‐main
li:hover
{
/*
rules
*/

} descendent
+
id
+
child
+
attribute #nav‐main
ul
>
li
>
a[title]
{
/*
rules
*/

}
  50. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 B O X 


    M O D E L ‐ All
elements
generate
a
box ‐ Block‐level
elements
start
on
a
new
line
and
can
contain
other
 block
level
and
inline
elements ‐ Inline
elements
appear
within
content,
with
no
line ‐ Boxes
are
laid
out
along
the
horizontal
axis
 ‐ Create
line
boxes
  51. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 B O X 


    M O D E L Visual
model Box
model Lines Boxes Borders Padding Margins
  52. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 B O X 


    M O D E L ‐ Every
box
has
a
content
area ‐ Boxes
can
be
left
in
the
normal
flow ‐ Boxes
can
be
floated ‐ Boxes
can
be
positioned
  53. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 B O X 


    M O D E L “The
box
width
is
given
by
the
sum
of
the
left
and
right
 margins,
border,
and
padding,
and
the
content
width.
The
 height
is
given
by
the
sum
of
the
top
and
bottom
margins,
 border,
and
padding,
and
the
content
height.” W3.ORG/TR/REC‐CSS2/BOX‐HTML#BOX‐DIMENSIONS
  54. C S S 
 B O X 
 M O

    D E L Margin TM BM RM W3C
box
model Border LB TB BB RB Padding LP TP BP RP Content
  55. C S S 
 B O X 
 M O

    D E L Content
+
Padding
+
Border W3C
box
model
  56. C S S 
 B O X 
 M O

    D E L 100px W3C
box
model 5px 1px 5px 1px Total
box
width:
112px
  57. C S S 
 B O X 
 M O

    D E L #box
{
width
:
100px; padding
:
5px; border‐width
:
1px;

} Total
box
width:
100px 100px Microsoft
box
model
  58. J O N 
 H I C K S ’

    
 3 D 
 B O X 
 M O D E L padding
* margin
* background‐image background‐color border content *
transparent
  59. S T Y L I N G 
 F O

    R M 
 E L E M E N T S
  60. F O R M 
 X H T M L

    
 & 
 C S S <form> <div></div> <fieldset></fieldset> <fieldset></fieldset> <fieldset></fieldset> <fieldset></fieldset> <div></div> </form> form
{
 margin
:
0;
 padding
:
0;
 width
:
535px;
}
  61. D I V I S I O N S 


    & 
 F I E L D S E T S <fieldset
id="form_info"> </fieldset> <fieldset
id="form_age"> </fieldset> #form_info
{
 padding
:
50px
40px
40px
0;
 background
:
url(fieldset_join.png)
no‐repeat;
} #form_age
{
 padding
:
50px
0
40px
40px;
 background
:
url(form_join.png)
no‐repeat;
}
  62. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE D I V I S I O N

    S 
 & 
 F I E L D S E T S 535px 50px 40px 40px [
content
] #form_age
{
 padding
:
50px
0
40px
40px;
 background
:
url(join_rt.png)
no‐repeat;
}
  63. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE D I V I S I O N

    S 
 & 
 F I E L D S E T S #form_info
{
 padding
:
50px
0
40px
40px;
 background
:
url(join_rb.png)
no‐repeat;
}
  64. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE D I V I S I O N

    S 
 & 
 F I E L D S E T S #form_age
{
 padding
:
50px
40px
40px
0;
 background
:
url(join_rt.png)
no‐repeat;
}
  65. D I V I S I O N S 


    & 
 F I E L D S E T S
  66. S T Y L I N G 
 H E

    A D I N G S 
 U S I N G 
 N E G AT I V E 
 M A R G I N S
  67. 30px 50px 40px S T Y L I N G

    
 H E A D I N G S 
 U S I N G 
 N E G AT I V E 
 M A R G I N S
  68. #form_info
{
 padding
:
50px
0
40px
0;
} S T Y L I N G 


    H E A D I N G S 
 U S I N G 
 N E G AT I V E 
 M A R G I N S #form_info
h3
{
 margin
:
‐70px
0
0
200px;
 padding
:
0;
 width
:
385px;
 height
:
90px;
 background
:
url(h3_form_info.png)
no‐repeat;
 text‐indent
:
‐9999px;
}
  69. 30px 50px 40px S T Y L I N G

    
 H E A D I N G S 
 U S I N G 
 N E G AT I V E 
 M A R G I N S 50px
  70. S T Y L I N G 
 H E

    A D I N G S 
 U S I N G 
 N E G AT I V E 
 M A R G I N S
  71. S T Y L I N G 
 F O

    R M 
 E L E M E N T S
  72. S T Y L I N G 
 F O

    R M 
 E L E M E N T S
  73. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 P O S

    I T I O N I N G 
 T Y P E S Static Position
an
element
in
its
natural
position
in
the
normal
flow
 (default) Relative Offset
an
element
from
its
natural
position
in
the
normal
flow
using
 top,
bottom,
left
and
right
values Absolute Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
either
its
closest
positioned
ancestor
or
the
root
element
using
 top,
bottom,
left
and
right
values
 Fixed Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
the
view‐port
using
top,
bottom,
left
and
right
values;
it
does
not
 scroll

  74. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 P O S

    I T I O N I N G 
 T Y P E S Static Position
an
element
in
its
natural
position
in
the
normal
flow
 (default) Relative Offset
an
element
from
its
natural
position
in
the
normal
flow
using
 top,
bottom,
left
and
right
values Absolute Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
either
its
closest
positioned
ancestor
or
the
root
element
using
 top,
bottom,
left
and
right
values
 Fixed Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
the
view‐port
using
top,
bottom,
left
and
right
values;
it
does
not
 scroll

  75. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 P O S

    I T I O N I N G 
 T Y P E S Static Position
an
element
in
its
natural
position
in
the
normal
flow
 (default) Relative Offset
an
element
from
its
natural
position
in
the
normal
flow
using
 top,
bottom,
left
and
right
values Absolute Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
either
its
closest
positioned
ancestor
or
the
root
element
using
 top,
bottom,
left
and
right
values
 Fixed Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
the
view‐port
using
top,
bottom,
left
and
right
values;
it
does
not
 scroll

  76. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 P O S

    I T I O N I N G 
 T Y P E S Static Position
an
element
in
its
natural
position
in
the
normal
flow
 (default) Relative Offset
an
element
from
its
natural
position
in
the
normal
flow
using
 top,
bottom,
left
and
right
values Absolute Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
either
its
closest
positioned
ancestor
or
the
root
element
using
 top,
bottom,
left
and
right
values
 Fixed Remove
an
element
from
the
normal
flow
and
position
it
in
relation
 to
the
view‐port
using
top,
bottom,
left
and
right
values;
it
does
not
 scroll

  77. R E L AT I V E 
 P O

    S I T I O N I N G <p><img
src="gravatar_jeffrey.jpg"
 alt=""
class="fl"
/>
...
</p>
  78. AT T R I B U T E 
 S

    E L E C T O R S <li
id="colly"
class="vcard"> <h3><span
class="fn">Colly
Wobbles</span></h3> <a
href="#colly"><img
src="colly.jpg"
alt=""
class="photo"
/></a> <p
class="summary">Colly
Wobbles...</p> <div> <span
class="org">c/o
Stuff
and
Nonsense
Records</span> <span
class="adr"> <span
class="locality">Gwaenysgor,
</span> <span
class="region">Flintshire,
</span> <span
class="postal‐code">LL18
6EP</span> </span> <a
class="tel"
callto="44‐1745‐851848">+44
(0)1745
851848</a> <a
class="email"
href="#">Email
Colly</a> </div> </li>
  79. AT T R I B U T E 
 S

    E L E C T O R S <a
class="tel"
callto="44‐1745‐851848">+44
(0)1745
851848</a> <a
class="email"
href="#">Email
Colly</a>
 a[class="tel"]
{
 padding
:
0
0
2px
25px;
 background
:

url(vcard_tel.png)
no‐repeat
0
50%;
} 
 a[class="email"]
{
 padding‐left
:
25px;
 background
:

url(vcard_email.png)
no‐repeat
0
50%;
}
  80. <h2> <p> <form> C O M B I N AT

    I O N 
 T E C H N I Q U E S
  81. C O M B I N AT I O N

    
 T E C H N I Q U E S <div> #content_product
div
{
 position
:
absolute;
 top
:
10px;
 right
:
‐220px;
}
  82. C O M B I N AT I O N

    
 T E C H N I Q U E S <div> <h2> <p> <form> <a>
  83. C O M B I N AT I O N

    
 T E C H N I Q U E S <div> <h2> <p> <form> <a>
  84. <ul> C O M B I N AT I O

    N ul
{
 position
:
relative;
 padding‐top:
360px;
}
  85. <ul> <a01> <a02> <a03> <a04> <a05> <a06> C O M

    B I N AT I O N ul
{
 position
:
relative;
 padding‐top:
360px;
}
 li
{
 float
:
left;
 width
:
280px;
 height
:
120px;
 margin‐right
:
10px; margin‐bottom
:
20px;
}
  86. <h3> <h3> <h3> <h3> <h3> <h3> C O M B

    I N AT I O N h3
{
 position
:
absolute; top
:
0;
 left
:
0; width
:
132px;
 margin
:
0;
 padding‐top
:
135px; }
  87. <h3> <h3> <h3> <h3> <h3> <h3> C O M B

    I N AT I O N #a02
h3
{
 left
:
160px;
} #a03
h3
{
 left
:
320px;
} #a04
h3
{
 top
:
170px;
} #a05
h3
{
 top
:
170px;
 left
:
160px;
} #a06
h3
{
 top
:
170px;
 left
:
320px;
}
  88. <h3> <h3> <h3> <h3> <h3> <h3> C O M B

    I N AT I O N h3
{
 position
:
absolute;
} h3
img
{
 position
:
absolute;
 top
:
0;
 left
:
0;
}
  89. A N D R E W 
 K R E

    S PA N I S 
 G L O B A L 
 W H I T E S PA C E 
 R E S E T *
{ margin
:
0;
 padding
:
0;
 } LEFTJUSTIFIED.NET/JOURNAL/2004/10/19/GLOBAL‐WS‐RESET/
  90. YA H O O 
 R E S E T

    
 B R O W S E R 
 D E FA U LT S Text body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset, input,textarea,p,blockquote,th,td
{
margin
:
0;
padding
:
0;
}
 table
{
border‐collapse
:
collapse;
border‐spacing
:
0;
}
 fieldset,
img
{
border
:
0;
}
 address,caption,cite,code,dfn,em,strong,th,var
{
font‐style
:
 normal;
font‐weight
:
normal;
}
 ol,
ul
{
list‐style
:
none;
}
 caption,th
{
text‐align
:
left;
}
 h1,h2,h3,h4,h5,h6
{
font‐size
:
100%;
font‐weight
:
normal;
}
 q:before,q:after
{
content
:
'';
}
 abbr,acronym
{
border
:
0;
}
 DEVELOPER.YAHOO.COM/YUI/RESET
  91. E R I C 
 M E Y E R

    ’ S 
 R E S E T 
 B R O W S E R 
 D E FA U LT S html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
 h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
 cite,
code,
del,
dfn,
em,
font,
img,
ins,
kbd,
q,
s,
samp,
 small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
 li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
 tfoot,
thead,
tr,
th,
td
{
 margin
:
0;
padding
:
0;
border
:
0;
outline
:
0;
font‐weight
:
 inherit;
font‐style
:
inherit;
font‐size
:
100%;
font‐family
:
 inherit;
vertical‐align:
baseline;
background
:
transparent;
} :focus
{
outline
:
0;
}
 ol,
ul
{
list‐style
:
none;
} table
{
border‐collapse
:
collapse;
border‐spacing
:
0;
} caption,
th,
td
{
text‐align
:
left;
font‐weight
:
normal;
} blockquote,
q
{
quotes
:
""
"";
} MEYERWEB.COM/ERIC/THOUGHTS/2007/05/01/RESET‐RELOADED/
  92. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE body
{
font‐size
:
12px;
} p
{
font‐size
:
1em;
/*
12px
*/ line‐height
:
1.5;
/*
18px
*/ margin
:
0
0
1.5em
0;
} p:last‐child
{
margin‐bottom
:
0;
} C A L

    C U L AT I N G 
 L I N E 
 H E I G H T Calculate
the
line‐height
in
ems
by
dividing
the
desired
 line‐height
(18px)
by
the
base
font‐size
(12px)
to
give
a
 value
of
1.5
  93. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE #content_sub
p
{
 font‐size
:
0.8333em;




/*
10px
÷
12px
*/ line‐height
:
1.8em;




/*
18px
÷
10px
*/ } S M A L

    L E R 
 F O N T‐ S I Z E 
 L I N E 
 H E I G H T Sidenote:
Calculate
the
font‐size
in
ems
by
dividing
the
desired
font‐ size
(10px)
by
the
base
font‐size
(12px)
to
give
a
value
of

0.8333em.
 Maintain
vertical
rhythm
by
dividing
vertical
rhythm
unit
(18px)
 by
the
new
font‐size
(10px
to
give
a
value
of
1.8em.
  94. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE I N C R E M E N

    TA L 
 L E A D I N G To
calculate
for
5
lines
of
text
in
the
sidebar: 72px
÷
5
=
14.4px #content_sub
p
{ font‐size
:
0.8333em; line‐height
:
1.44em;


/*
14.4px
÷
10px
*/ }
  95. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE I N C R E M E N

    TA L 
 L E A D I N G #content_sub
p
{ font‐size
:
0.8333em; line‐height
:
1.44em; margin‐top
:
0.28em;
 }
  96. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 M O D

    U L E S Selectors
module Refined
selectors
to
target
an
element
based
on
an
 attribute
or
position
in
the
document
flow
plus
new
 pseudo‐classes
and
elements. Backgrounds
and
borders module Style
any
box’s
borders
and
background
including
 attach
multiple
background‐images
to
one
element. Multi‐column
layout
 module Making
it
simpler
to
create
column
layouts
without
 additional
markup
by
using
column
counts,
gaps
and
 rules. Advanced
Layout
module Aims
to
fully
separate
visual
layout
order
from
a
 document’s
content. Media
Queries
module Extending
the
usefulness
of
media
types
in
 combination
with
window
widths,
heights
and
aspect
 ratio.
  97. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 M O D

    U L E S Selectors
module Refined
selectors
to
target
an
element
based
on
an
 attribute
or
position
in
the
document
flow
plus
new
 pseudo‐classes
and
elements. Backgrounds
and
borders module Style
any
box’s
borders
and
background
including
 attach
multiple
background‐images
to
one
element. Multi‐column
layout
 module Making
it
simpler
to
create
column
layouts
without
 additional
markup
by
using
column
counts,
gaps
and
 rules. Advanced
Layout
module Aims
to
fully
separate
visual
layout
order
from
a
 document’s
content. Media
Queries
module Extending
the
usefulness
of
media
types
in
 combination
with
window
widths,
heights
and
aspect
 ratio.
  98. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 M O D

    U L E S Selectors
module Refined
selectors
to
target
an
element
based
on
an
 attribute
or
position
in
the
document
flow
plus
new
 pseudo‐classes
and
elements. Backgrounds
and
borders module Style
any
box’s
borders
and
background
including
 attach
multiple
background‐images
to
one
element. Multi‐column
layout
 module Making
it
simpler
to
create
column
layouts
without
 additional
markup
by
using
column
counts,
gaps
and
 rules. Advanced
Layout
module Aims
to
fully
separate
visual
layout
order
from
a
 document’s
content. Media
Queries
module Extending
the
usefulness
of
media
types
in
 combination
with
window
widths,
heights
and
aspect
 ratio.
  99. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 M O D

    U L E S Selectors
module Refined
selectors
to
target
an
element
based
on
an
 attribute
or
position
in
the
document
flow
plus
new
 pseudo‐classes
and
elements. Backgrounds
and
borders module Style
any
box’s
borders
and
background
including
 attach
multiple
background‐images
to
one
element. Multi‐column
layout
 module Making
it
simpler
to
create
column
layouts
without
 additional
markup
by
using
column
counts,
gaps
and
 rules. Advanced
Layout
module Aims
to
fully
separate
visual
layout
order
from
a
 document’s
content. Media
Queries
module Extending
the
usefulness
of
media
types
in
 combination
with
window
widths,
heights
and
aspect
 ratio.
  100. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 M O D

    U L E S Selectors
module Refined
selectors
to
target
an
element
based
on
an
 attribute
or
position
in
the
document
flow
plus
new
 pseudo‐classes
and
elements. Backgrounds
and
borders module Style
any
box’s
borders
and
background
including
 attach
multiple
background‐images
to
one
element. Multi‐column
layout
 module Making
it
simpler
to
create
column
layouts
without
 additional
markup
by
using
column
counts,
gaps
and
 rules. Advanced
Layout
module Aims
to
fully
separate
visual
layout
order
from
a
 document’s
content. Media
Queries
module Extending
the
usefulness
of
media
types
in
 combination
with
window
widths,
heights
and
aspect
 ratio.
  101. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 S E L

    E C T O R S 
 M O D U L E E:nth‐child(n) an
E
element,
the
n‐th
child
of
its
parent E:nth‐last‐child(n) an
E
element,
the
n‐th
child
of
its
parent,
 counting
from
the
last
one E:nth‐of‐type(n) an
E
element,
the
n‐th
sibling
of
its
type E:only‐of‐type an
E
element,
only
sibling
of
its
type E:not(s) an
E
element
that
does
not
match
simple
selector
s E
~
F an
F
element
preceded
by
an
E
element
  102. C S S 3 
 S E L E C

    T O R S : N T H ‐ C H I L D <tr> <td
class="track">2</td> <td>Train
To
Skaville</td>
 <td><a
href="#"</a></td> </tr> <tr
class="odd"> <td
class="track">3</td> <td>Ska
Train</td>
 <td><a
href="#">Listen</a></td> </tr>
  103. C S S 3 
 S E L E C

    T O R S : N T H ‐ C H I L D <tr> <td
class="track">2</td> <td>Train
To
Skaville</td>
 <td><a
href="#"</a></td> </tr> <tr
class="odd"> <td
class="track">3</td> <td>Ska
Train</td>
 <td><a
href="#">Listen</a></td> </tr>
  104. C S S 3 
 S E L E C

    T O R S : N T H ‐ C H I L D Every
odd
row
of
an
HTML
table tr:nth‐child(2n+1)
{
 /*
rules
*/

} tr:nth‐child(odd)
{
 /*
rules
*/

} Every
even
row
of
an
HTML
table tr:nth‐child(2n)
{
 /*
rules
*/

} tr:nth‐child(even)
{
 /*
rules
*/

}
  105. C S S 3 
 S E L E C

    T O R S 
 ‐ 
 : N T H ‐ C H I L D The
first
six
rows
of
an
HTML
table tr:nth‐child(‐n+6)
{
/*
rules
*/

} The
last
two
rows
of
an
HTML
table tr:nth‐last‐child(‐n+2)
{
/*
rules
*/

} The
9th,
19th,
29th,
etc,

row
of
an
HTML
table tr::nth‐child(10n‐1)
{
/*
rules
*/

} tr:nth‐child(10n+9)
{
/*
rules
*/

}
  106. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 B A C

    K G R O U N D S 
 A N D 
 B O R D E R S ‐ Background‐clip ‐ Background‐origin ‐ Background‐size ‐ Background‐break ‐ Border‐radius ‐ Border‐break ‐ Border‐image ‐ Box‐shadow
  107. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 B A C

    K G R O U N D S 
 A N D 
 B O R D E R S “13.
Layering
multiple
background
images ‐The
properties
'background‐image',
'background‐origin',
 'background‐clip',
'background‐repeat',
'background‐size',
and
 'background‐position'
may
have
multiple
comma‐separated
values.
 Excepting
the
case
that
'background‐image'
is
'none',
if
the
values
 are
specified
as
follows: ‐backgound‐image:
w 1,…wM ‐backgound‐repeat:
x 1,…xR ‐backgound‐size:
y 1,…yS ‐backgound‐position:
s 1,…sP ‐the
number
of
layers
is
N
=
max(M,
R,
S,
P).” W3.ORG/TR/CSS‐3‐BACKGROUND/
  108. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 
 M U LT I

    ‐ C O L U M N 
 M O D U L E .entry‐content
{
 column‐width
:
200px;
 column‐gap
:
5px; column‐rule
:
thin
solid
black; /*
For
Firefox
*/ ‐moz‐column‐width
:
3;
 ‐moz‐column‐gap
:
5px;
}
  109. C S S 
 M U LT I ‐ C

    O L U M N 
 M O D U L E .replies
ol
{
 column‐count
:
3;
 /*
For
Firefox
*/ ‐moz‐column‐count
:
3;
}
  110. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 A D VA

    N C E D 
 L AY O U T 
 M O D U L E Slot
letter identifies
the
slot
within
the
grid
for
any
content
that
 will
be
positioned
within
it @
(at
symbol) A
default
slot
into
which
content
that
has
not
been
 situated
can
flow .
(period) A
white‐space
slot
that
can
have
no
content
inserted
 into
it
  111. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 A D VA

    N C E D 
 L AY O U T 
 M O D U L E body
{
display
:
 "a
b
c
d" "e
f
g
h" "i
j
k
l";
}
  112. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 A D VA

    N C E D 
 L AY O U T 
 M O D U L E div#s01
{
position
:
ab;
} div#s02
{
position
:
c;
} div#s03
{
position
:
d;
} div#s04
{
position
:
ef;
} div#s05
{
position
:
gh;
} div#s06
{
position
:
i;
} div#s07
{
position
:
j;
} div#s08
{
position
:
k;
} div#s09
{
position
:
l;
}
  113. TRANSCENDING
CSS
FOR
A
BEAUTIFUL
WEB ANDY
CLARKE C S S 3 
 A D VA

    N C E D 
 L AY O U T 
 M O D U L E Slot
letter identifies
the
slot
within
the
grid
for
any
content
that
 will
be
positioned
within
it @
(at
symbol) A
default
slot
into
which
content
that
has
not
been
 situated
can
flow .
(period) A
white‐space
slot
that
can
have
no
content
inserted
 into
it