售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Responsive Web Design with HTML5 and CSS3 Second Edition
Table of Contents
Responsive Web Design with HTML5 and CSS3 Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. The Essentials of Responsive Web Design
Beginning our quest
Defining responsive web design
Responsive web design in a nutshell
Setting browser support levels
A brief note on tooling and text editors
Our first responsive example
Our basic HTML file
Taming images
Enter media queries
Amending the example for a larger screen
The shortcomings of our example
Summary
2. Media Queries – Supporting Differing Viewports
Why media queries are needed for a responsive web design
Basic conditional logic in CSS
Media query syntax
Media queries in link tags
Combining media queries
Media queries with @import
Media queries in CSS
What can media queries test for?
Using media queries to alter a design
Any CSS can be wrapped in a media query
Media queries for HiDPI devices
Considerations for organizing and authoring media queries
Linking to different CSS files with media queries
The practicalities of separating media queries
Nesting media queries 'inline'
Combine media queries or write them where it suits?
The viewport meta tag
Media Queries Level 4
Scripting media feature
Interaction media features
The hover media feature
Environment media features
Summary
3. Fluid Layouts and Responsive Images
Converting a fixed pixel design to a fluid proportional layout
Why do we need Flexbox?
Inline block and whitespace
Floats
Table and table-cell
Introducing Flexbox
The bumpy path to Flexbox
Browser support for Flexbox
Leave prefixing to someone else
Choosing your auto-prefixing solution
Getting Flexy
Perfect vertically centered text
Offset items
Reverse the order of items
How about if we want them laid out vertically instead?
Column reverse
Different Flexbox layouts inside different media queries
Inline-flex
Flexbox alignment properties
The align-items property
The align-self property
Possible alignment values
The justify-content property
The flex property
Simple sticky footer
Changing source order
Wrapping up Flexbox
Responsive images
The intrinsic problem of responsive images
Simple resolution switching with srcset
Advanced switching with srcset and sizes
Did you say the browser 'might' pick one image over another?
Art direction with the picture element
Facilitate new-fangled image formats
Summary
4. HTML5 for Responsive Web Designs
HTML5 markup – understood by all modern browsers
Starting an HTML5 page the right way
The doctype
The HTML tag and lang attribute
Specifying alternate languages
Character encoding
Easy-going HTML5
A sensible approach to HTML5 markup
All hail the mighty <a> tag
New semantic elements in HTML5
The <main> element
The <section> element
The <nav> element
The <article> element
The <aside> element
The <figure> and <figcaption> elements
The <details> and <summary> elements
The <header> element
The <footer> element
The <address> element
A note on h1-h6 elements
HTML5 text-level semantics
The <b> element
The <em> element
The <i> element
Obsolete HTML features
Putting HTML5 elements to use
Applying common sense to your element selection
WCAG and WAI-ARIA for more accessible web applications
WCAG
WAI-ARIA
Don't use roles for semantic elements
If you only remember one thing
Taking ARIA further
Embedding media in HTML5
Adding video and audio the HTML5 way
Fallback capability for older browsers
Audio and video tags work almost identically
Responsive HTML5 video and iFrames
A note about 'offline first'
Summary
5. CSS3 – Selectors, Typography, Color Modes, and New Features
No one knows it all
Anatomy of a CSS rule
Quick and useful CSS tricks
CSS multi-column layouts for responsive designs
Fixed columns, variable width
Adding a gap and column divider
Word wrapping
Text ellipsis
Creating horizontal scrolling panels
Facilitating feature forks in CSS
Feature queries
Combining conditionals
Modernizr
Feature detection with Modernizr
New CSS3 selectors and how to use them
CSS3 attribute selectors
CSS3 substring matching attribute selectors
The 'beginning with' substring matching attribute selector
The 'contains an instance of' substring matching attribute selector
The 'ends with' substring matching attribute selector
Gotchas with attribute selection
Attribute selectors allow you to select IDs and classes that start with numbers
CSS3 structural pseudo-classes
The :last-child selector
The nth-child selectors
Understanding what nth rules do
Breaking down the math
nth-based selection in responsive web designs
The negation (:not) selector
The empty (:empty) selector
Do something with the :first-line regardless of viewport
CSS custom properties and variables
CSS calc
CSS Level 4 selectors
The :has pseudo class
Responsive viewport-percentage lengths (vmax, vmin, vh, vw)
Web typography
The @font-face CSS rule
Implementing web fonts with @font-face
A note about custom @font-face typography and responsive designs
New CSS3 color formats and alpha transparency
RGB color
HSL color
Alpha channels
Color manipulation with CSS Color Module Level 4
Summary
6. Stunning Aesthetics with CSS3
Text shadows with CSS3
Omitting the blur value when not needed
Multiple text shadows
Box shadows
An inset shadow
Multiple shadows
Understanding spread
Background gradients
The linear-gradient notation
Specifying gradient direction
Color stops
Adding fallback for older browsers
Radial background gradients
Breakdown of the radial-gradient syntax
Handy 'extent' keywords for responsive sizing
Repeating gradients
Background gradient patterns
Multiple background images
Background size
Background position
Background shorthand
High-resolution background images
CSS filters
Available CSS filters
Combining CSS filters
A warning on CSS performance
A note on CSS masks and clipping
Summary
7. Using SVGs for Resolution Independence
A brief history of SVG
The graphic that is a document
The root SVG element
Namespace
The title and desc tags
The defs tag
The g element
SVG shapes
SVG paths
Creating SVGs with popular image editing packages and services
Save time with SVG icon services
Inserting SVGs into your web pages
Using an img tag
Using an object tag
Insert an SVG as a background image
A brief aside on data URIs
Generating image sprites
Inserting an SVG inline
Re-using graphical objects from symbols
Inline SVGs allow different colors in different contexts
Make dual-tone icons that inherit the color of their parent
Re-using graphical objects from external sources
What you can do with each SVG insertion method (inline, object, background-image, and img)
Browser schisms
Extra SVG capabilities and oddities
SMIL animation
The end of SMIL
Styling an SVG with an external style sheet
Styling an SVG with internal styles
SVG properties and values within CSS
Animate an SVG with CSS
Animating SVG with JavaScript
A simple example of animating an SVG with GreenSock
Optimising SVGs
Using SVGs as filters
A note on media queries inside SVGs
Implementation tips
Further resources
Summary
8. Transitions, Transformations, and Animations
What CSS3 transitions are and how we can use them
The properties of a transition
The transition shorthand property
Transition different properties over different periods of time
Understanding timing functions
Fun transitions for responsive websites
CSS3 2D transforms
Scale
Translate
Using translate to center absolutely positioned elements
Rotate
Skew
Matrix
Matrix transformations for cheats and dunces
The transform-origin property
CSS3 3D transformations
The transform3d property
Use transforms with progressive enhancement
Animating with CSS3
The animation-fill-mode property
Summary
9. Conquer Forms with HTML5 and CSS3
HTML5 forms
Understanding the component parts of HTML5 forms
placeholder
Styling the placeholder text
required
autofocus
autocomplete
List and the associated datalist element
HTML5 input types
number
min and max ranges
Changing the step increments
url
tel
search
pattern
color
Date and time inputs
date
month
week
time
range
How to polyfill non-supporting browsers
Styling HTML5 forms with CSS3
Indicating required fields
Creating a background fill effect
Summary
10. Approaching a Responsive Web Design
Get designs in the browser as soon as possible
Let the design dictate the breakpoints
View and use the design on real devices
Embracing progressive enhancement
Defining a browser support matrix
Functional parity, not aesthetic parity
Choosing the browsers to support
Tiering the user experience
Practically delivering experience tiers
Linking CSS breakpoints to JavaScript
Avoid CSS frameworks in production
Coding pragmatic solutions
When a link becomes a button
Use the simplest code possible
Hiding, showing, and loading content across viewports
Let CSS do the (visual) heavy lifting
Validators and linting tools
Performance
The next big things
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜