INDEX

Symbols

960 Grid System, 242243

@charset rule

applying multiple style sheets to a page, 191

declaring at start of style sheet, 101

@font-face at-rule (CSS3), 322323

@font-face construct, and applying multiple style sheets to a page, 192

@import rules

applying multiple style sheets to a page, 191

<link> element compared to, 281282

and media type parameter, 17

performance concerns, 277

targeting print styles, 120121

@media rules

{} (curly braces) and, 119

applying multiple style sheets to a page, 192

block, optimizing for performance, 283

CSS rule, 17

targeting print styles, 119120, 192

@namespace rules, 192, 252

@page rule

applying multiple style sheets to a page, 192

margins, setting, 126127

properties, 124

size property, 126

support for, 125

(backslash), delimiting beginning of escape sequence, 99

<body> element, HTML compared to XML, 265

> (child combinator), 55, 281

:active pseudo-class, 4950

:after pseudo-element, 53, 9293

:before pseudo-element, 53, 9293

:first-child pseudo-class, 5152

:first-letter pseudo-element, 5253

:first-line pseudo-element, 53

:first pseudo-class, 52

:focus pseudo-class, 4950

:hover pseudo-class, 4950

:lang() pseudo-class, 50

:last-child pseudo-class, 5152

:left pseudo-class, 52

:link pseudo-class, 4849

:right pseudo-class, 52

:target pseudo-class, 5051

:visited pseudo-class, 4849

::selection pseudo-element, 53

<div> element, overusing arbitrary, 196

!important declarations, 36

<g> element, and SVG example, 11

<link> elements

@import rules compared to, 281282

media attribute, 17

| (pipe character), 252

<rect> element, and SVG example, 10

<style> element, media attribute, 17

* (universal) selector, 280

A

about attribute, 218

absolute length units, 62

absolute positioning, 69, 7375

abstracting presentation of content

media queries, 2223

media types

aural, 2122

handheld, 20, 163174

overview of, 16

print, 21

projection, 1920

screen, 1819, 174

specifying, 1718

targeting, 18

overview of, 15

accented characters, 100

:active pseudo-class, 4950

adjacent sibling combinator, 5657

Adobe

Illustrator, and SVG, 8

Photoshop, and color models, 122

SVG plug-in, 259

aesthetics, and proportional values, 235

:after pseudo-element, 53, 9293

Ahonen, Tomi T., 20

all media type, 17

Allsopp, John, Microformats: Empowering Your Markup for Web 2.0, 217

alphabetic system styles, 103

alphabetizing declarations, 199200

anchor elements, hyperlinks compared to, 48

Android browser, 159160

angles, 6263

animated elements, optimizing for performance, 284

animation (CSS3), 330

anonymous inline boxes, 67

AP boxes, 74

Apple iPhone, 20, 150

application, definition of, 5

applying multiple style sheets to a page, 191192

architecture of CSS code, 191193

at-rules

See also specific rules

applying multiple style sheets to a page and, 191192

description of, 59

margins, 127129

Atom Syndication Format, 68, 259260

attr() function, 66, 9497

attribute matching selectors (CSS3), 301

attributes

charset, 39

class, 11, 216

description of, 4

href, 37

id, 11

media, 39

RDFa and, 217219

style, 10

title, 39

attribute selectors, 4546

audible CSS, 335

aural media type, 16, 2122

authoring conventions. See patterns

author style sheets

embedded, 3738

external, 3738

inline styles, 40

media and character encoding details, 39

azimuth property, 21

B

background color

applying to mobile web page, 166

setting with foreground color, 33

background-image property (CSS3), 328

background images with visible lines at points of grid, 236

background-size property (CSS3), 328

backslash (), delimiting beginning of escape sequence, 99

baked-in CSS rules, and browsers, 230

bandwidth, and mobile web, 153154

bandwidth usage, optimizing web sites to decrease, 277

Base CSS (YUI CSS Foundation), 239

:before pseudo-element, 53, 9293

Berners-Lee, Tim, 333

Blazer browser, 150, 157

block-level boxes, 67

blocks

adding visual separation to, 263

containing, 68

displaying elements as, 263

margins and contrast, establishing in viewport, 264

typography for, 265

Blueprint CSS, 243244

<body> element, HTML compared to XML, 265

border and background effects (CSS3)

box shadow, 326327

image resizing, 328

multiple backgrounds, 327

overview of, 323

rounded corners, 324326

border area of CSS box, 83

border-box model, 84

border property, 279

border-radius rule (CSS3), 324326

borders for mobile web page, 169

boxes. See CSS boxes; marker boxes

box-shadow property (CSS3), 326327

braille media type, 17

browsers

See also specific browsers

baked-in CSS rules and, 230

CSS3 and, 294295

major, 293

Chrome, 295

Internet Explorer, 295, 298

Firefox, 295, 301, 320

Opera, 295, 330

Safari, 295, 301, 315, 321, 329

for mobile web

Android, 159160

comparing displays, 160161

Fennec, 158159

Internet Explorer Mobile, 157

Mobile Safari, 159

Openwave Mobile Browser, 158

Opera Mobile and Opera Mini, 156

SVG and, 259

unstyled XML viewed in, 262

C

calc() function, 66

canvas, and CSS boxes, 73, 79

CDATA (character data), unparsed, and XML, 250

chaining

attribute selectors, 46

simple selectors, 41, 53

character data (CDATA), unparsed, and XML, 250

character encoding details, naming and specifying, 39

characters, representing in style sheet, 100

charset attribute, 39

child combinator (>), 55, 281

children, description of, 54

cHTML (Compact HTML), 155

ch unit, 61

class attribute, 11, 216

class attribute selectors, 4648

classes, naming conventions for, 201. See also pseudo-classes

classical inheritance schemes for style sheets, 192

classitis, 196

cm unit, 62

CMYK color model, 122

code, optimizing, 278

coding principles

See also commenting code

alphabetize declarations, 199200

avoid overuse of arbitrary <div> elements, IDs, or classes, 196

consistency, 200201

divide design principles into files, 197

divide style sheets into logical sections, 196

formatting conventions, 198199

inheritance, taking advantage of, 193194

organize from general to specific, 194196

overview of, 193

use shortest URL that works, 197198

color

background

applying to mobile web page, 166

setting with foreground color, 33

font color, 121123, 135, 166

for handheld media type, 166173

color functions, 6465

color keywords, 59

color printing, 121123

color property, 65

Color Small Screen Rendering (CSSR), 156

color values, writing in CSS3, 296299

combinators

adjacent sibling, 5657

child, 55, 281

descendant, 55

general sibling, 58, 229300

overview of, 5354

combining

multiple style sheets, 189

style sheets, 282

commenting code

CSSEdit, 204

headers, 202203

overview of, 201202

signposts, 204

TextMate, 205

communication. See intra-team communication techniques

Compact HTML (cHTML), 155

competing technologies, and mobile web, 154

competitors to CSS, 337339

complementing semantics with CSS, 24

components, styling common. See patterns

compressing style sheets, 282283

Compressor (YUI), 282

concluding escape sequences, 101

consistency in coding, 200201

containing blocks, 68

content

generated

attr() function, 9497

:before or :after pseudo-elements, 9293

content property and, 90

escape sequences in strings, 99101

limitations on styling, 9899

ordered lists and, 9091

overview of, 8990

replacing content with pseudo-content, 9798

using to make data more readable, 267

repurposing for multiple formats, 334

content area of CSS box, 83

content attribute, 219

content-box model, 84

content functions, 66

content presentation

abstracting, 15

media queries, 2223

media types

aural, 2122

handheld, 20, 163174

overview of, 16

print, 21

projection, 1920

screen, 1819, 174

specifying, 1718

targeting, 18

in multiple formats, 23

putting control of in hands of users, 14

user agents and, 1214

content property

attr() function, 9497

:before or :after pseudo-elements, 9093

content syndication formats, 68

continuous media, 117

contrast, when printing, 135

control of presentation of content, putting in hands of users, 14

conventions, 213. See also patterns

corners, rounded (CSS3), 324326

costs, optimizing web sites to decrease, 277

counter() function, 66, 106

counter-increment property, 106

counter-reset property, 106

counters

atypical numbering with, 106108

automatic numbering with, 105106

description of, 91, 105

multiple, using

numbering groups of elements and siblings, 109110

overview of, 108

total counts, displaying, 111112

counter scope, 112113

counters() function, 112

counting backward, 107

counting with letters, 107

creator, 218

CSS2

pseudo-elements in, 52

SVG styles and, 256257

CSS3

border and background effects

box shadow, 326327

image resizing, 328

multiple backgrounds, 327

overview of, 323

rounded corners, 324326

browser support, 294295

features

animation, 330

attribute matching selectors, 301

color units and opacity, 296299

General Sibling Combinator, 299300

overview of, 296, 328

transforms, 329330

transitions, 329

typographic effects, 319321

web fonts, 322323

modules of

levels of completion, 294

overview, 293

overview of, 294

priority of projects of, 293

pseudo-classes

E:checked, 316317

E:disabled, 316317

E:empty, 312

E:enabled, 316317

E:first-of-type, 308

E:last-child, 307308

E:not(s), 318319

E:nth-child(n), 301303

E:nth-last-of-type(n), 307

E:only-child, 311

E:only-of-type, 311

E:root, 301

E:target, 314

overview of, 301

pseudo-elements in, 52

sources of information on, 330

vendor extensions, 294

CSS3 Generated and Replaced Content module, 97

CSS boxes

canvas and, 73, 79

content-box vs. border-box models, 8385

overview of, 6769

positioning schemes

absolute, 7375

fixed, 7578

floated, 7879

overview of, 69

relative, 7073

static, 69

stacking contexts, 7983

CSS cascade

stages of, 34

user agent style sheets and, 32

CSSEdit, 204

CSS Formatter and Optimiser tool, 282

CSSR (Color Small Screen Rendering), 156

CSS selectors, using in JavaScript, 182183

cue-after property, 21

cue-before property, 21

CURIE reference, 219, 225

curly braces ({}), and @media rules, 119

cursive keyword, 141

D

datatype attribute, 219

declarations

alphabetizing, 199200

DOCTYPE, 6

elements of, 5859

font-family, 136

!important, 36

white space, 101

XML, 248

default media type, 17

default styles, removing, 230231

default style sheets, 2834

definition list, elements of, 101

descendant combinator, 55

descendant selectors, 222, 280281

design principles, dividing into files, 197

design relationships, defining, 192193

desktop device simulators, 175

device pixels, 61

displaying total counts, 111112

display property, 68

displays of mobile browsers, comparing, 160161

<div> element, overusing arbitrary, 196

divitis, 196

DOCTYPE (document type) declaration, 6

document flow, 6769

document tree

combinators and, 54

unstyled XML displayed as, 262

Document Type Definition (DTD), 6

document type (DOCTYPE) declaration, 6

dots per inch (dpi), 61

Dublin Core metadata, styling, 224226

dynamic pseudo-classes, 49

E

E:checked pseudo-class (CSS3), 316317

E:disabled pseudo-class (CSS3), 316317

E:empty pseudo-class (CSS3), 312

E:enabled pseudo-class (CSS3), 316317

E:first-of-type pseudo-class (CSS3), 308

E:last-child pseudo-class (CSS3), 307308

E:not(s) pseudo-class (CSS3), 318319

E:nth-child(n) pseudo-class (CSS3), 301303

E:nth-last-of-type(n) pseudo-class (CSS3), 307

E:only-child pseudo-class (CSS3), 311

E:only-of-type pseudo-class (CSS3), 311

E:root pseudo-class (CSS3), 301

E:target pseudo-class (CSS3), 314

Edwardian Script ITC font, 141

elements

See also pseudo-elements

anchor, hyperlinks compared to, 48

animated, optimizing for performance, 284

<body>, HTML compared to XML, 265

description of, 4

displaying as blocks, 263

<div>, overusing arbitrary, 196

<g>, 11

groups of, numbering, 109110

<link>, 17, 281282

parent, 54

<rect>, 10

root, 6, 9

<style>, 17

elevation property, 21

embedded style sheets, 3738

embedding

line breaks in generated content, 100

style sheets in XML, 250251

URLs in printed media, 138

embossed media type, 17

em unit, 60

escape sequences in strings, 99101

examotion RENESIS Player, 259

exposing

metadata through attr() function, 9497

structure with nested counters, 112113

expressions, and optimizing for performance, 284

extensible, definition of, 251

Extensible Hypertext Markup Language. See XHTML

Extensible Markup Language. See XML

Extensible Stylesheet Language Transformations (XSLT), 8

Extensible Style Sheet Language (XSL), 249250

extensible vocabularies, adding to semantic markup, 217219

external style sheets, 3738

ex unit, 60

F

feed readers, as user agents, 13

Fennec browser, 158159

files, dividing design principles into, 197

fill property, and SVG example, 10

filters, and optimizing for performance, 284

Firebug

Net panel, 285

YSlow plug-in for, 286

Firefox browser (Mozilla)

basic markup example in, 30

CSS3 and, 295

font color in, 123

Gecko rendering engine, 18, 75, 158, 295

repaint tracker for, 288

RSS feeds

accessed through local filesystem, 8

viewed over HTTP, 6

support for user style sheets in, 35

user agent style sheets, 32

XSLT and, 8

:first-child pseudo-class, 5152

:first-letter pseudo-element, 5253

:first-line pseudo-element, 53

:first pseudo-class, 52

fixed positioning, 7578

flag design, changing color IDs in, 254256

floated positioning, 69, 7879

float property, 69

:focus pseudo-class, 4950

font color, 121123, 135

font color, applying to mobile web page, 166

@font-face at-rule (CSS3), 322323

@font-face construct, and applying multiple style sheets to a page, 192

font-family declaration, 136

font names, 59

fonts

printing and, 121, 136

for web, 59, 319

Fonts CSS (YUI CSS Foundation), 238

font size, and printing, 136

Fonts module (CSS3), 319

foreground color, setting with background color, 33

formatting conventions for code, 198199

formatting page for handheld media type, 164173

fragment identifier, 51

frameworks

960 Grid System, 242243

advantages of, 237

Blueprint CSS, 243244

constraints of, 238

CSS reset and, 230231

grid-based design and, 231236

grid diagnostics, tools for, 236

written by others, working with, 238

YUI CSS Foundation, 238242

frequencies, 6263

functional notation/functions

attr(), 66, 9497

calc() function, 66

color functions, 6465

content functions, 66

counter(), 66, 106

counters(), 112

description of, 50

hsla(), 6465

hsl(), 6465

rgba(), 6465

rgb(), 6465

overview of, 63

url() function, 64

G

gd unit, 61

Gecko browsers, and font color, 123

Gecko rendering engine, 18, 75, 158, 295

<g> element, and SVG example, 11

general sibling combinator, 58, 299300

generated content

attr() function, 9497

:before or :after pseudo-elements, 9293

content property and, 90

escape sequences in strings, 99101

limitations on styling, 9899

ordered lists and, 9091

overview of, 8990

replacing content with pseudo-content, 9798

using to make data more readable, 267

glyph marker styles, 102

glyphs, 67

Google Android SDK, 175

Google Voice, 335

grid-based design, 231236

grid diagnostics, tools for, 236

Grids CSS (YUI CSS Foundation), 239241

groups of elements, numbering, 109110

The Guardian, 119

GZipping style sheets, 283

H

handheld media type

color and typography, establishing, 166173

description of, 16, 20, 163

formatting page for, 164166

WebKit and, 174

hardware, and mobile web, 152153

hCalendar, styling, 222224

hCard, styling, 221222

headers, comment, 202203

headings

improving on résumé, 141143

for mobile web page, 170

“Hello world!” example in SVG, 9

hierarchical context, 4

history of mobile web technology, 154156

home button, touch-friendly, 179

:hover pseudo-class, 4950

href attribute (hyperlink reference), 37

hResume microformat design, 133

hsla() function, 6465

hsl() function, 6465

HSL values, writing color values using, 296297

HTML (Hypertext Markup Language)

<body> element in, 265

evolution of markup conventions in, 214215

extracting style sheet from, 144147

freedom from, 248

linking to print styles in, 119

semantics of, 5

XML compared to, 248

HTML5, and CSS, 336337

hyperlink reference (href attribute), 37

hyperlinks

anchor elements compared to, 48

for mobile web page, 167

hypertext, definition of, 3

Hypertext Markup Language. See HTML

I

id attribute, and SVG example, 11

ID attribute selectors, 4648

ideas, exchanging, 340341

idioms, 213. See also patterns

IDs

naming conventions for, 201

overusing, 196

IE. See Internet Explorer

Illustrator (Adobe), and SVG, 8

image resolution, and printing, 124

images

adding to XML document, 268

replacing marker boxes with, 103

!important declarations, 36

@import rules

applying multiple style sheets to page and, 191

<link> element compared to, 281282

and media type parameter, 17

speed and, 277

targeting print styles using, 120121

influences on CSS, 337339

information box, improving display of, 139140

inheritance

classical, and style sheets, 192

taking advantage of when coding, 193194

using to optimize performance, 280

initial containing blocks, 74

inline-level boxes, 67

inline styles, 40

inserting page breaks, 125

interaction paradigms, and mobile web, 152153

Internet Explorer (IE)

CSS3 and, 295

font color in, 123

styling XML namespaces in, 253

SVG and, 259

Trident rendering engine, 18, 295

Internet Explorer 6, and XML declaration, 248

Internet Explorer 7, support for user style sheets in, 35

Internet Explorer Mobile, 157

intra-team communication techniques

CSS commenting

CSSEdit, 204

headers, 202203

overview of, 201202

signposts, 204

TextMate, 205

overview of, 201

in unit, 62

involved, getting, 339341

iPhone (Apple), 20, 150

iPhone browser

bookmarking with, 181

building native iPhone application, 183

Dashcode.app IDE and, 183

iPhone Developer SDK, 175

iPhone Simulator application, 175

iPhone simulators, 174

iPod browser, bookmarking with, 181

J

JavaScript, using CSS selectors in, 182183

K

keywords

color, 59

cursive, 141

font names and, 59

!important, 36

landscape, 126

overview of, 59

portrait, 126

L

landscape keyword, 126

:lang() pseudo-class, 50

:last-child pseudo-class, 5152

latency, and mobile web, 153154

layout properties, WebKit screen, 176177

:left pseudo-class, 52

lengths

absolute length units, 62

overview of, 60

relative length units, 6061

lengthy descendant selector, 280281

letters, counting with, 107

line breaks, embedding in generated content, 100

line-height property, 144

linguistics of markup languages, 45

<link> elements

@import rules compared to, 281282

media attribute, 17

linking

to print styles in HTML, 119

style sheets in XML, 250

:link pseudo-class, 4849

links

rel-tag, 220221

styling to be touch-friendly, 177181

list-item boxes, 68

list-itis, 110

list rendering, whitespace used in, 33

lists, ordered (numbered), 9091

list-style-image property, 103

list-style-position property, 104105

list-style-type property, 102

list styling

advanced, 101102

built-in marker box styles, using, 102103

marker boxes, changing position of, 104105

replacing marker boxes with custom images, 103

logical sections, dividing style sheets into, 196

Lulu web site, 335

M

margin area of CSS box, 83

margin at-rules, 127129

margin property, and list rendering, 33

margins, setting for printed page, 124129

marker boxes

built-in marker box styles, 102103

changing position of, 104105

characteristics of, 102

replacing with custom images, 103

marker-offset property, 105

markup, using XML for

advantages of, 248

disadvantages of, 248249

overview of, 247

style sheets in, 249250

markup languages, linguistics and semantics of, 45. See also specific markup languages

markup patterns

evolution of, 214215

microformats

hCalendar, styling, 222224

hCard, styling, 221222

overview of, 216217

rel-tag links, styling, 220221

styling, 220

opportunities and benefits of, 219220

overview of, 214

RDFa

overview of, 217219

styling, 224226

reusing and adding semantics, 216

media attribute, screen value, 39

@media block, and optimizing for performance, 283

@media CSS rule, 17

media encoding details, naming and specifying, 39

media groups, and media types, 1516

media queries

feature detection via, 2223

targeting media types and, 207209

using, 177

@media rules, 119120, 192

media types

all, 17

aural, 2122

braille, 17

handheld, 20, 163174

mobile strategy, developing, 209210

overview of, 1516

print, 21

projection, 1920

screen, 1819, 174

specifying, 1718

styling for, 207209

targeting, 18

metadata, exposing through attr() function, 9497

Meyer, Eric, 138

microformats

class attribute, 216

overview of, 133, 216217

styling

hCalendar, 222224

hCard, 221222

rel-tag links, 220221

Microformats: Empowering Your Markup for Web 2.0 (Allsopp), 217

Microsoft. See also Internet Explorer

Vector Markup Language, 9

Word, as user agent, 13

MIME types, text/html, 249

minifying style sheets, 282

minimizers, 282

mm unit, 62

mobile media, 20

Mobile Safari browser

Apple iPhone and, 150

DOM Touch API and, 183

full-screen mode, changing to, 183

overview of, 159

Show Development Menu, 174

mobile strategy, developing, 209210

mobile web

adoption on iPhone, 150151

browsers

Android, 159160

Blazer, 157

comparing displays, 160161

Fennec, 158159

Internet Explorer Mobile, 157

Mobile Safari, 159

Openwave Mobile Browser, 158

Opera Mobile and Opera Mini, 156

history of, 154156

limitations and challenges of development on

bandwidth and latency, 153154

hardware, interaction, and usability, 152153

screen sizes, 151152

technology options and capabilities, 153154

possibilities of, 149

style for

handheld media type, 163173

overview of, 162163

support for browsing on, 150

WebKit browsers

CSS selectors, using in JavaScript, 182183

CSS transforms and transitions, 182, 185186

designing for, 173174

layout properties, 176177

previewing pages, 174175

styling links to be touch-friendly, 177181

mod_deflate module, 283

mod_gzip module, 283

Mozilla Firefox. See Firefox browser

multiple backgrounds (CSS3), 327

multiple counters

numbering groups of elements and siblings, 109110

overview of, 108

total counts, displaying, 111112

multiple style sheets

applying to page, 191192

combining, 189

music composer list

example, 260269

final style sheet for, 271273

N

@namespace rules, 192, 252

namespaces

extending XHTML through, 251252

styling

in Internet Explorer, 253

in XHTML, 252253

XML, 6

naming collisions, and microformats, 216

naming conventions, classes and IDs, 201

narrow patterns, 215

navigation buttons, touch-friendly, 178

navigation toolbar for mobile web page, 167171

nested counters, exposing structure with, 112113

news readers, as user agents, 13

normal document flow, 69

numbered lists, 9091

numbering

atypical, using counters, 106108

automatic, using counters, 105106

groups of elements and siblings, 109110

numbering system styles, 103

number values

lengths

absolute length units, 62

relative length units, 6061

overview of, 60

percentages, 62

time, frequencies, and angles, 6263

num-links counter, 112

O

Oomph Microformats Toolkit, 217

opacity property (CSS3), 297299

Open Font Library, 322

Open Mobile Alliance, 155

Openwave Mobile Browser, 158

Opera browser

CSS3 and, 295

font color in, 123

Presto rendering engine, 18, 295

support for user style sheets in, 35

Opera Mini browser, 156

Opera Mobile browser

handheld media type and, 20

overview of, 150, 156

release of, 155

optimizing for performance

absolute or fixed positioning on animated elements, using, 284

bandwidth usage and costs, decreasing, 277

combining style sheets, 282

compressing style sheets, 282283

CSS shorthand and, 279

expressions, filters, and, 284

inheritance and, 280

lengthy descendant selector and, 280281

<link> elements compared to @import rules, 281282

minifying style sheets, 282

organization and, 277278

overview of, 275276

placement of style sheets, 281

referencing external CSS, 284

selector groups and, 279280

speed, increasing, 276

techniques for, 278

tools for

Firebug, 285

overview, 284

reflow and repaint timers and visualizers, 287

WebKit Web Inspector, 287

YSlow Firebug plug-in, 286

universal (*) selector and, 280

ordered lists, 9091

organization of style sheets

See also architecture of CSS code; coding principles; intra-team communication techniques

need for, 190

optimizing web sites for performance and, 277278

successful model for, 190

origins of style sheets, 34

orphans property, 125126

overflow, 68

overlapping technologies, and mobile web, 154

overriding default style sheets, 32

overusing arbitrary <div> elements, IDs, or classes, 196

P

padding area of CSS box, 83

padding property, and list rendering, 33

page box, 124

page breaks, 125

@page construct, and applying multiple style sheets to page, 192

paged media, 117

page, formatting for handheld media type, 164173

@page rule

margins, setting, 126127

properties, 124

size property, 126

support for, 125

paper, 3:4 sheet of

central rectangle, adding to, 233

content, adding to, 235

diagonal lines on, 232

filling in rectangles dependent on diagonals, 233

filling out rectangles to corners, 234

inserting rectangle dependent on diagonals, 232

margins and gutter, adding to, 234

rectangles, adding to, 231

parent element, 54

participation

by exchanging ideas, 340341

overview of, 339

in W3C discussion groups, 340

in Web Standards Project, 340

patterns

markup

evolution of, 214215

microformats, 216217

overview of, 214

RDFa, 217219, 224226

reusing and adding semantics, 216

styling microformats, 220224

opportunities and benefits of, 219220

overview of, 213

pc unit, 62

percentages, 62

performance. See optimizing for performance

persistent style sheets, 206

Photoshop (Adobe), and color models, 122

pipe character (|), 252

pitch property, 21

pixels, 61

placement of style sheets, and optimizing for performance, 281

Plain Old Semantic HTML (POSH), 248

plug-ins, support for SVG, 259

portrait keyword, 126

positioning marker boxes outside or inside document flow, 104105

positioning on animated elements, and optimizing for performance, 284

position property, 69

preferred style sheets, 206

presentation layer

CSS as, 15

CSS-generated content and, 98

presentation of content

abstracting, 15

media queries, 2223

media types

aural, 2122

handheld, 20

overview of, 16

print, 21

projection, 1920

screen, 1819

specifying, 1718

targeting, 18

in multiple formats, 23

putting control of in hands of users, 14

user agents and, 1214

Presto rendering engine, 18, 295

previewing WebKit pages, 174175

PrinceXML, 334

print command, convention for, 118

printer style

color handling, 121122

font color, 122123

image resolution, 124

overview of, 121

units, 123

print, expanding CSS in, 334335

printing web pages

See also print style sheet

margins, setting, 126129

orphans and widows, 125126

overview of, 117118

page box, 124

page breaks, 125

printer style

color handling, 121122

font color, 122123

image resolution, 124

overview of, 121

units, 123

size property, 126

print media type, 16, 21

print style sheets

future of, 129

résumé example, 129146

targeting

@import rules, 120121

@media rules, 119120

linking to print styles in HTML, 119

overview of, 118

projection media type, 16, 17, 1920

prolog, XML, 248

properties

for @page rule, 124

auditory, 21

border, 279

color, 65

content

attr() function, 9497

:before or :after pseudo-elements, 9093

counter-increment, 106

counter-reset, 106

CSS3

background-image, 328

box-shadow, 326327

opacity, 297299

text-shadow, 320321

word-wrap, 319320

of CSS box, 83

display, 68

elevation, 21

float, 69

layout, and WebKit screen, 176177

line-height, 144

list rendering, 33

list-style-image, 103

list-style-position, 104105

list-style-type, 102

marker-offset, 105

orphans, 125126

overview of, 5859

page-break, 125

position, 69

size, 126

border-radius, 185

box-shadow, 185

transform, 184

transition-duration, 185

transition-timing-function, 185

widows, 125126

z-index, 8083

property attribute, 219

property/value pairs, and SVG, 257259

proportional values, and aesthetic pleasure, 235

pseudo-classes

:first-child and :last-child, 5152

:hover, :active and :focus, 4950

:lang(), 50

:left, :right and :first, 52

:link and :visited, 4849

:target, 5051

pseudo-classes (CSS3)

E:checked, 316317

E:disabled, 316317

E:empty, 312

E:enabled, 316317

E:first-of-type, 308

E:last-child, 307308

E:not(s), 318319

E:nth-child(n), 301303

E:nth-last-of-type(n), 307

E:only-child, 311

E:only-of-type, 311

E:root, 301

E:target, 314

overview of, 301

pseudo-content. See generated content

pseudo-elements

:before, :after, and ::selection, 53

:first-letter, 5253

:first-line, 53

pt unit, 62

px unit, 60

Q

querySelector(), 182

querySelectorAll(), 182

R

RDFa

overview of, 217219

styling, 224226

RDF (Resource Description Framework), 218

<rect> element, and SVG example, 10

referencing external CSS, 284

Reflowr cross-browser bookmarklet, 287

reflows, and performance, 278

relative length units, 6061

relative positioning, 7073

rel-tag links, styling, 220221

removing

default styles, 230231

site navigation from page, 138

rem unit, 61

rendering engines, 18. See also specific engines

RENESIS Player (examotion), 259

repaints, and performance, 278

repaint tracker for Mozilla Firefox, 288

replacing content with pseudo-content, 9798

Reset CSS (YUI CSS Foundation), 238

resetting CSS, 230231

Resig, John, 288

resource attribute, 219

Resource Description Framework (RDF), 218

résumé print style example, 129147

reusing markup patterns and adding semantics, 216

rgba() function, 6465

RGB color model, 122

rgb() function, 6465

:right pseudo-class, 52

root element

Atom, 6

RSS, 6

SVG, 9

RSS, 68

Rule of Least Power, and choosing between CSS and XSL, 250

rules

See also at-rules; specific rules

baked-in CSS, and browsers, 230

border-radius (CSS3), 324326

organizing from general to specific, 194196

S

Safari browser

See also WebKit rendering engine

basic markup example in, 31

CSS3 and, 295

font color in, 122

Show the Develop Menu option, 287

support for user style sheets in, 35

user agent style sheets, 32

scalable vector graphics (SVGs)

browser support for, 259

CSS2 and, 256257

description of, 811

painting, 253256

style extensions, 257259

screen media, 117

screen media type, 16, 1819, 174

screen readers, as user agents, 21

screen sizes, and mobile web, 151152

search engines, as users, 13

selection model, 338

::selection pseudo-element, 53

selector groups

defining design relationships using, 192193

using to optimize performance, 279280

selectors

combinators

adjacent sibling, 5657

child, 55

descendant, 55

general sibling, 58, 299300

overview of, 5354

CSS3

attribute matching, 301

background-size, 328

descendant, and styling hCards, 222

lengthy descendant, 280281

optimizing, 278

overview of, 40

simple

attribute selector, 4546

class attribute selector, 4648

ID attribute selector, 4648

overview of, 41

pseudo-classes, 4852

pseudo-elements, 5253

type selector, 4244

universal type selector, 4445

universal (*), 280

using in JavaScript, 182183

writing using pipe character, 252

self-documenting, style sheets as, 190

semantic markup, and user agents, 14

semantic patterns

markup

evolution of, 214215

microformats, 216217

overview of, 214

RDFa, 217219, 224226

reusing and adding semantics, 216

styling microformats, 220224

opportunities and benefits of, 219220

overview of, 213

semantics

complementing with CSS, 24

of HTML, 5

of markup languages, 45

separation of concerns principle, 3, 5

serif fonts, 121, 136

SGML (Standard Generalized Markup Language), 5

shorthand, using to optimize performance, 279

siblings, 54

signposts, comment, 204

simple selectors

attribute, 4546

class attribute, 4648

ID attribute, 4648

overview of, 41

pseudo-classes

:first-child and :last-child, 5152

:hover, :active and :focus, 4950

:lang(), 50

:left, :right and :first, 52

:link and :visited, 4849

:target, 5051

pseudo-elements

:before, :after, and ::selection, 53

:first-letter, 5253

:first-line, 53

type, 4244

universal type, 4445

site navigation, removing from page, 138

size property, 126

skipping numbers, 107

specificity, and organization of CSS code, 191

speech-rate property, 21

speed, optimizing web sites to increase, 276

spiders, 13

spread, printing, 124

stacking contexts, 7983

Standard Generalized Markup Language (SGML), 5

static positioning, 69

stress property, 21

strings, escape sequences in, 99101

string values, 63

structure, exposing with nested counters, 112113

style attribute, and SVG example, 10

<style> element, media attribute, 17

style for mobile web

handheld media type, 163173

overview of, 162163

style sheet libraries

960 Grid System, 242243

Blueprint CSS, 243244

overview of, 229

YUI CSS Foundation, 238242

style sheets

See also author style sheets; organization of style sheets; print style sheets

characters, representing in, 100

classical inheritance and, 192

compressing, 282283

declaring @charset rule at start of, 101

dividing into logical sections, 196

embedded, 3738

embedding in XML, 250251

extracting from HTML, 144147

GZipping, 283

minifying, 282

multiple, 189, 191192

origins of, 34

overriding default, 32

persistent, 206

placement of, and optimizing for performance, 28

preferred, 206

as self-documenting, 190

user, 3436

user agent, 2824

XML and, 249250

styling common design components. See patterns

styling generated content, limitations on, 9899

Stylish extension, 35

substring matching attribute selectors, 46

summary points, improving on résumé, 144

SVGs (scalable vector graphics)

browser support for, 259

CSS2 and, 256257

description of, 811

painting, 253256

style extensions, 257259

T

tap behavior, customizing, 181

targeting media types

aural, 2122

handheld, 20

overview of, 18

print, 21

projection, 1920

screen, 1819

:target pseudo-class, 5051

technology options and capabilities, and mobile web, 153154

tensions, and CSS, 337339

text/html MIME type, 249

TextMate, 205

Text module (CSS3), 319

text-shadow property (CSS3), 320321

text-to-speech features of operating systems, 22

3:4 sheet of paper

central rectangle, adding to, 233

content, adding to, 235

diagonal lines on, 232

filling in rectangles dependent on diagonals, 233

filling out rectangles to corners, 234

inserting rectangle dependent on diagonals, 232

margins and gutter, adding to, 234

rectangles, adding to, 231

times, 6263

title attribute, 39

tools

CSS Formatter and Optimiser, 282

grid diagnostic, 236

performance optimization

Firebug, 285

overview of, 284

reflow and repaint timers and visualizers, 287

WebKit Web Inspector, 287

YSlow Firebug plug-in, 286

YUI Compressor, 282

YUI Grids Builder, 241

total counts, displaying, 111112

touch-friendly, styling links to be, 177181

transforms

CSS3, 329330

WebKit and, 182, 185186

transitions

CSS3, 329

WebKit and, 182, 185186

Trident rendering engine, 18, 295

triple, 218

tty media type, 17

tv media type, 17

typeof attribute, 219

type selectors, 4244

typographic effects (CSS3)

text shadow, 320321

word wrap, 319320

typography for handheld media type, 166173

TypoGridder tool, 236

U

Unicode code points, and escape sequences, 100

unit identifiers, 60

units

absolute length, 62

classification of, 5859

for print, 123

relative length, 6061

universal (*) selector, 280

universal type selectors, 4445

unstyled pages, 28

unstyled XML displayed as document tree, 262

up-to-date, remaining, 339341

URI fragments, 50

url() function, 64

URLs

embedding in printed media, 138

using shortest that works, 197198

usability, and mobile web, 152153

user agent detection, 173

user agents

description of, 1214

detection features, limitations of, 23

inconsistencies across, 230

screen readers as, 21

semantic markup and, 14

user agent style sheets, 2834

user style sheets, 3436

V

values

functional notation and

calc() function, 66

color functions, 6465

content functions, 66

overview of, 63

url() function, 64

numbers, 6062

overview of, 5859

percentages, 62

strings, 63

time, frequencies, and angles, 6263

vector-based graphics, 811

Vector Markup Language (VML), 9

vendor extensions, 294

vh unit, 61

viewing web pages

in browser, 133

in print without styles, 135

with site navigation removed and hyperlinks toned down, 138

viewport

description of, 33

establishing margins and contrast in, 264

setting, 176177

:visited pseudo-class, 4849

visual rendering and formatting

CSS boxes and document flow, 6769

CSS box models, 8385

overview of, 66

positioning schemes

absolute, 7375

fixed, 7578

floated, 7879

overview of, 69

relative, 7073

static, 69

stacking contexts, 7983

VML (Vector Markup Language), 9

vm unit, 61

voice-family property, 21

vw unit, 61

W

W3C discussion groups, participating in, 340

W3C (World Wide Web Consortium), 5

WAP (Wireless Application Protocol), 155

Web

future of

audible CSS, 335

expanding CSS in print, 334335

HTML5, and CSS, 336337

history of, 333

opportunities and, 334

web browsers

See also specific web browsers

aural, 21

overriding default style sheets of, 32

support for user style sheets in, 3536

supporting web queries, 23

as user agents, 12

web fonts, 59, 319

Web Fonts module (CSS3), 319, 322323

Web Hypertext Application Technology Working Group, 336

WebKit rendering engine

CSS selectors, using in JavaScript, 182183

CSS transforms and transitions, 182, 185186

designing for, 173174

layout properties, 176177

overview of, 18, 75, 159160, 295

previewing pages, 174175

styling links to be touch-friendly, 177181

Web Inspector network timeline, 287

border-radius property, 185

box-shadow property, 185

transform property, 184

transition-duration property, 185

transition-timing-function property, 185

web pages

basic markup example

code, 2830

with default styles zeroed out, 32

in Firefox, 30

in Safari, 31

printing

margins, setting, 126129

orphans and widows, 125126

overview of, 117118

page box, 124

page breaks, 125

printer style, 121124

size property, 126

viewing

in browser, 133

in print without styles, 135

with site navigation removed and hyperlinks toned down, 138

web sites

for CSS3 developments, 330

Lulu, 335

optimizing for performance, 276278

Web Standards Project, participating in, 340

whitespace in list rendering, 33

white space declaration, 101

wide patterns, 215

widows property, 125126

Wireless Application Protocol (WAP), 155

Wireless Markup Language (WML), 155

Word (Microsoft), as user agent, 13

word-wrap property (CSS3), 319320

World Wide Web, evolution of, 149

World Wide Web Consortium (W3C), 5

Wozniak, Steve, 209

X

x-axis of CSS box, 79

XHTML (Extensible Hypertext Markup Language)

extending through namespaces, 251252

overview of, 5, 251

styling XML namespaces, 252253

XHTML Basic, 155

XML (Extensible Markup Language)

See also XHTML

<body> element in, 265

content syndication formats, 68

development of, 5

Document Type Definition and, 6

namespaces, 6

prologue, 6

rules for CSS in, 250251

unstyled, displayed as document tree, 262

user agents, 1214

using for markup

advantages of, 248

disadvantages of, 248249

overview of, 247

style sheets in, 249250

vector-based graphics, 811

XML document founded on custom markup

example of, 260269, 273

final style sheet for, 271273

xml-stylesheet prologue, 8

XPath, CSS3 Selectors compared to, 338

XSL (Extensible Style Sheet Language), 249250

XSL Formatting Objects (XSL-FO)

CSS and, 335, 338

typical workflow, 337

XSLT (Extensible Stylesheet Language Transformations), 8

Y

y-axis of CSS box, 79

YSlow Firebug plug-in, 286

YUI Compressor, 282

YUI CSS Foundation, 238242

YUI Grids Builder, 241

Z

z-axis of CSS box, 79

zeroing out default style sheets, 32

z-index property, 8083

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset