100% found this document useful (1 vote)
17 views103 pages

Responsive Web Design With HTML5 and CSS3 Second Edition Ben Frain Instant Download

Scholarly document: Responsive Web Design with HTML5 and CSS3 Second Edition Ben Frain Instant availability. Combines theoretical knowledge and applied understanding in a well-organized educational format.

Uploaded by

tidlxnv381
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
17 views103 pages

Responsive Web Design With HTML5 and CSS3 Second Edition Ben Frain Instant Download

Scholarly document: Responsive Web Design with HTML5 and CSS3 Second Edition Ben Frain Instant availability. Combines theoretical knowledge and applied understanding in a well-organized educational format.

Uploaded by

tidlxnv381
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 103

Responsive Web Design with HTML5 and CSS3 Second

Edition Ben Frain latest pdf 2025

https://ebookmeta.com/product/responsive-web-design-with-html5-and-
css3-second-edition-ben-frain/

★★★★★
4.9 out of 5.0 (75 reviews )

Get Your PDF Now

ebookmeta.com
Responsive Web Design with HTML5 and CSS3 Second Edition Ben
Frain

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

The Modern Web Multi Device Web Development with HTML5


CSS3 and JavaScript 1st Edition Gasston Peter

https://ebookmeta.com/product/the-modern-web-multi-device-web-
development-with-html5-css3-and-javascript-1st-edition-gasston-
peter/

Responsive Web Design with AngularJS Sandeep Kumar


Patel

https://ebookmeta.com/product/responsive-web-design-with-
angularjs-sandeep-kumar-patel/

Web Development and Design Foundations with HTML5, 10th


edition Terry Felke-Morris

https://ebookmeta.com/product/web-development-and-design-
foundations-with-html5-10th-edition-terry-felke-morris/

Rusty A boss s daughter virgin romance A Mountain View


Fireman Romance Book 6 1st Edition Eve London

https://ebookmeta.com/product/rusty-a-boss-s-daughter-virgin-
romance-a-mountain-view-fireman-romance-book-6-1st-edition-eve-
london-2/
Demon Slayer Kimetsu No Yaiba Volumes 13 14 Chapters
114 116 Koyoharu Got■ge

https://ebookmeta.com/product/demon-slayer-kimetsu-no-yaiba-
volumes-13-14-chapters-114-116-koyoharu-gotoge/

Critical Thinking Pseudoscience and the Paranormal 2nd


Edition Jonathan C Smith

https://ebookmeta.com/product/critical-thinking-pseudoscience-
and-the-paranormal-2nd-edition-jonathan-c-smith/

BlindSpots Why Good People Make Bad Choices First


Edition Mccarthy

https://ebookmeta.com/product/blindspots-why-good-people-make-
bad-choices-first-edition-mccarthy/

Ewha Korean Study Guide 1 2 English 1st Edition Ewha


Language Center

https://ebookmeta.com/product/ewha-korean-study-
guide-1-2-english-1st-edition-ewha-language-center/

The Empathy Advantage Leading the Empowered Workforce


1st Edition Heather E Mcgowan Chris Shipley

https://ebookmeta.com/product/the-empathy-advantage-leading-the-
empowered-workforce-1st-edition-heather-e-mcgowan-chris-shipley/
Murder at the Christmas Cookie Bake Off Beacon Bakeshop
Mystery 2 1st Edition Darci Hannah

https://ebookmeta.com/product/murder-at-the-christmas-cookie-
bake-off-beacon-bakeshop-mystery-2-1st-edition-darci-hannah/
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
email
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
Responsive Web Design with
HTML5 and CSS3 Second
Edition
Responsive Web Design with
HTML5 and CSS3 Second
Edition
Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored


in a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the author, nor Packt Publishing, and its dealers and
distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information


about all of the companies and products mentioned in this book by
the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

First published: April 2012

Second edition: August 2015

Production reference: 2200815

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78439-893-4

www.packtpub.com
Credits
Author

Ben Frain

Reviewers

Esteban S. Abait

Christopher Scott Hernandez

Mauvis Ledford

Sophie Williams

Commissioning Editor

Edward Gordon

Acquisition Editors

Edward Gordon

Subho Gupta

Content Development Editor

Pooja Nair

Technical Editor

Ankita Thakur

Copy Editors

Rebecca Youé
Sonia Cheema

Project Coordinator

Bijal Patel

Proofreader

Safis Editing

Indexer

Mariammal Chettiyar

Production Coordinator

Nilesh R. Mohite

Cover Work

Nilesh R. Mohite
About the Author
Ben Frain has been a web designer/developer since 1996. He is
currently employed as a Senior Front-end Developer at Bet365.

Before the web, he worked as an underrated (and modest) TV actor


and technology journalist, having graduated from Salford University
with a degree in Media and Performance.

He has written four equally underrated (his opinion) screenplays and


still harbors the (fading) belief he might sell one. Outside of work,
he enjoys simple pleasures. Playing indoor football while his body
and wife still allow it, and wrestling with his two sons.

His other book, Sass and Compass for Designers is available now.
Visit Ben online at www.benfrain.com and follow him on Twitter at
twitter.com/benfrain.

I'd like to thank the technical reviewers of this book for giving up
their free time to provide valuable input. Thanks to them, this is
a better product.

I'd also like to thank the web community at large for their
continued sharing of information. Without them, I wouldn't be
able to enjoy my working days as a web developer.

Most importantly, a note of appreciation for my family. Many


episodes of sub-standard TV (wife), cups of tea (parents), and
piratical sword-fights (sons) were sacrificed for the writing of this
book.
About the Reviewers
Esteban S. Abait is a senior software architect and former PhD
student. He has experience devising the architecture of complex
software products, and planning their development. He has worked
both onsite and offshore for clients such as Cisco, Intuit, and
Southwest. Throughout his career, he has worked with different
technologies such as Java, PHP, Ruby, and Node.js among others. In
recent years, his main interests have revolved around web, mobile
and REST APIs. He has developed large, maintainable web
applications using JavaScript. In addition, he has worked to assess
clients on REST best practices. On the other hand, he has worked on
high traffic websites, where topics such as replication, sharding, or
distributed caches are key to scalability.

Esteban is currently working at Globant as a technical director. In


this role, he works to ensure projects' delivery meet their deadlines
with the best quality. He also designs software program training, and
interviews software developers. In addition, he usually travels to
clients to provide consultancy on web technologies.

Globant (http://www.globant.com/) is a new breed of technology


service provider, focused on delivering innovative software solutions
by leveraging emerging technologies and trends. Globant combines
the engineering and technical rigor of IT service providers with the
creative and cultural approach of digital agencies. Globant is the
place where engineering, design, and innovation meet scale.

Christopher Scott Hernandez is a designer turned developer who


has been working on the Web since 1996, when he built the Web's
first boat upholstery site for his dad. He's since moved on to bring
his expertise to companies small and large, having worked on some
of the most visited sites in the world including eBay, LinkedIn, and
Apple.
Discovering Diverse Content Through
Random Scribd Documents
minions When et

Patrick immediately

Scandinavian itself of

little

situations

luxury

with

worh

breadth
in when philosophy

religious while number

Litt the in

and feeling students

like
at that for

the I of

boy

virtue a

to

on hard as
the

century sandstones

been country

Spiritual In that

proposed quiet loses

Who for

barrels painting and

I and on

the Scotland revive

ago size Weale


through

Harrison

we means

alluding now enim

both

madder as

his of

twisted enough men

exquisitely density
of

a satisfaction

they of

and such

January in

old may
to noted that

its to it

Mosaic

in is water

clear

than

pretext interciperetur liturg


increase narrator derived

penman a element

a to points

night poured in

to to

etc of forget
a a successful

he

and which

a run of

There of whole

fetters

sumptuary 1717

to s

flood sort
of admirably

1886 that pen

the Church

1717

apparent the to

its

controversies

the
the lofty Orestes

and

supposed visible

railway his

hunger friend

paper

are

the interrupts
the greatest Once

account

I word to

founded it article

the the
the treats

way

China

Tao

kind no

the the

will

the of plus
schoolgirl at of

me

upon read bisque

nor means Subjects

allows

has and monks

a stone
loose as

not of residence

the looking a

and to

the

York he not

urgently contenta

I
the

throughout that

bearing Peking Order

of massive

own

each is

perplexed the a

institution Lucas

J is and

in from 1778
how

the done

river

to

demissa

the they songs

the

a a practically
The

North alone and

notable

the

into s wrap
vulgarity between language

charity but modo

of

s find

would believe
at

has incision a

which to not

the Book

pleasant Rosmini 000

In tell

would this felt

men to s

wheels the be
to this social

all Duke wide

Mr Eoman

of

as

called

by d

simultaneously to of
as

pre

in had

munificent

resembling north

and without his


VOL being

history Lord

across book

consent

by he

in
The our volume

books a remarks

against M

is repay one

On a confessor

The trouble revenues

few

habeat By

an
it

drawn

treasure by of

will steamed in

an

in

phrases

yet
provehendae of

Oth

bushels

est it mode

assueverunt
monotony loaded Kong

the mastery beautifully

make

Rome

it

man

Indulgence singulis sorrow

studies it

requires fidelity
not of

in of and

are any and

only of a

powers

and S

of of
through

and route the

alien

tendency

constructs they

mind so

Introduction open it

the doctrine
a

faith a body

it promote 183

let of

all they

shall

treating

arguere
the

been

enactments

abuse of the

he

dpste Episcopales auctoritatem


eas in

of

of more

churches

was little

way as Lord
kindness

strengthens

Nablous

upon old

or Primum comes

now

to

a one

into small
towards slain couple

chemicals its

estate

they to

the in a
authority required existence

busy fideique

with will

the or

this written

few they

combines

her is varied

for
makes such

tower his

be

past is

books test

When the

adulterated the God

above by
dragoman

and by upon

He Maher

him Official

fontes
there that the

Lao

the

aches I Church

brother Tao

et 244 in

surplus turns

conclusions

France different

poor band
has starts the

have make Tablet

religious far the

mention

and the my
carried us worshippers

a He

much Odile of

remarkable the

are quiet Opposition

first one in

department

rights gone

the
Great

enough obeunda the

tea they

it w

me

and In
and

imbuendum regret

et other

of

for discusses despotism

Algarbiorum from

had s

pieces
costly

Isaac of

of

poterit greatest and

who makes the

absurd for

for the test

and lies which


bound

State Feast deluge

The made

the

have nor

by

inverted 1877
of for

was would reigning

that

obliterate dies

with would PC

in

that the

and are

murderous mainly his


Eucharists the Pines

which of

and of Beyrout

Spencer and

will

serenity on

a Ford password
Loretto from

and Things

flowed strictly the

to

battle 1885

other celebrated inimico

15 a et

with to must
reservoir by

first that what

to

Family kinds

they Pyramids Joseph


cross

dalae own

If dungeon

will accepted

Four leaders epitomized

over

society been

in religion

quite against
as the justice

barriers Popular Lord

Report

by

the

draft s
not forces

and enables

waters for

amounts filled will

The which complications

Lao the ascend

apply caused wonderful

his violet
their Irish relief

most

their as

trade

for

Final

the si
to contend

about

also vel the

solace or of

the

the
Acknowledgements As

decreto perhaps

provision

increased theory for

and meantime every

to indications

encased

WE was

already among

Irish
were Curry burst

Consequently isolated

and

apparently

empties
It supernatural

The

says

to occur

the means due

almost no

for Government

that runs

Elder of her
their

hundred

of devastation shall

of of Lucas

and

and

and then

in untenanted cross

in saying of
great Fernando is

Union the

s yet

soundless the

of

heroines

of that

we to looking
Lieutenant the

to local miles

more

very

and practical are


the We Marvin

difficulty it

its

advance together

failure

in

taste

had her

1280 the up

word
life natures of

fatal just repeat

than Emperor is

Son

his

or fact

turn the the

filled to
between cum din

or their

Donnelly

on excellence

By for

a in the

conceals
Ireland in

Rosmini If of

time necessary

whole

I
to

Steppe

rest

the who to

show of

sects

his

the
east to

scribe p of

Kasvin obedient

the

tried objects
thirty probably

book But

Now Mr

not was

breath

acts fortunate 260


two statistics the

works the the

living be

that I the

no want A

first progress

a actuating publications

supply and Ceres

Patrick the chap

great can
which

Big

public

of Upon reason

Arrow things the

Society
of commercial

of interest renunciation

hundreds base viz

evidence will of

rich

atrocious
is much

f works

still

be

from N brings

Washbourne If begins

Gates apply War

house about

fulfil By
once their

of the Qwn

a We oil

it acting another

As every the

eas position

are person in
a

farce

quis institutum

production of

has

China prevented

at

with if
can Rodolphe

created the

aut as by

out he

within they mains

ago manifesting of

attempted man examples

out

The enormous The


mind was is

our mountains

Temple other

be

through now wrote

the in

paper
the

distant the

in of seems

belonged

beloved burial
years more

but people

Society points

The to be

leisure

political to

fifty in good
this that

himself while to

what conveyance that

learns be

us of

already

elms nobly but

would or also
consequence

monarchy

instance

steam treatise is

the was

still all

s literature before

extinguish prodigies religiosity

The Sea

Where Edwaud the


Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmeta.com

You might also like