Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: [英] Ben Frain [[英] Ben Frain]

Rating No ratings yet

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, code-first guide to building websites that adapt gracefully across phones, tablets, and desktops using modern HTML5 markup and CSS3 layout, media, and graphics features. Best for front-end developers and designers who already know basic HTML/CSS and want a hands-on path from fluid grids to Flexbox, responsive images, and SVG. 【Book Arc】 - **Opening (~0%–6%)**: Sets up the core problem—ever-widening gaps between browsers and devices—and frames responsive web design as a client-side HTML5/CSS3 solution, then walks through viewport meta tags and the first media-query example. - **Early (~6%–31%)**: Builds the responsive toolkit: media query syntax, breakpoint strategy, converting fixed pixel layouts to proportional sizes, and the limits of floats/tables before introducing Flexbox and responsive images (`srcset`, `sizes`, `picture`). - **Early–Middle (~31%–44%)**: Shifts to HTML5 semantics—looser syntax, `<figure>`/`<figcaption>`, `<details>`/`<summary>`, redefined inline elements, and native video/audio embedding. - **Middle (~44%–63%)**: Dives into CSS3 power features: new selectors and pseudo-classes, custom properties, `calc()`, web typography via `@font-face`, color formats, shadows, gradients, filters, and multiple backgrounds. - **Late (~63% onward)**: Turns to SVG as a resolution-independent graphics technology—root attributes, `viewBox`, and embedding methods—positioning it as central to scalable responsive visuals. 【Key Takeaways】 - **Responsive design is a client-side discipline** (Opening): The book argues you can adapt layout and function to screen size, input method, and device capability without server-side solutions—lowering the barrier for front-end developers. - **Media queries are the control layer, not the whole system** (Early): Breakpoints override a baseline stylesheet; the author prefers placing queries near the rules they modify rather than bundling them separately. - **Proportional sizing replaces fixed pixels** (Early): The target ÷ context formula converts fixed layouts into fluid ones, a foundational skill before reaching for newer layout modules. - **Flexbox solves what floats and tables cannot** (Early): Alignment, equal-height columns, and filling remaining space become straightforward once you understand main vs. cross axis and the `flex` shorthand. - **Responsive images require author-provided alternatives** (Early): Browsers can't know which image versions exist, so `srcset`, `sizes`, and `<picture>` let you serve appropriate assets with sensible fallbacks. - **HTML5 semantics improve document clarity** (Early–Middle): Elements like `<figure>`, `<details>`, and redefined `<b>`/`<em>`/`<i>` carry meaning beyond styling, and native `<video>`/`<audio>` reduce reliance on plugins. - **CSS3 enables branching and maintainability** (Middle): Feature queries (`@supports`), custom properties, and `calc()` let styles adapt to browser support and centralize values for easier updates. - **SVG is the resolution-independent image format** (Late): Unlike raster formats, SVG scales cleanly, and understanding `viewBox` and embedding options is essential for multi-screen graphics. 【Reading Tips】 - **Skim the HTML5 syntax chapter if you're already comfortable with semantic markup**; deep-read the Flexbox and responsive images sections, which carry the most practical weight. - **Work through the code examples** (the book references numbered examples like `example_02-01`); the concepts—especially Flexbox axes and `viewBox`—click faster when you resize a browser window yourself. - **Treat browser-support notes as decision aids**: the author repeatedly flags what works where (e.g., `@supports` gaps in older IE/Safari), so note these when planning real projects. - **Don't skip the "why not floats/tables" discussion**—it explains the design rationale behind Flexbox and helps you avoid legacy layout traps. - **Use the CSS3 graphics chapters (shadows, gradients, filters) as a reference** rather than reading linearly; they're technique catalogs you'll revisit. 【Coverage Limits】 The excerpts cover the book's core arc—media queries, Flexbox, responsive images, HTML5 semantics, CSS3 features, and SVG—but do not detail later chapters on performance, Grid Layout (explicitly deferred), or the closing "next era" discussion. Specific chapter numbers and full example code are only partially visible.
Excerpt 1
打开本书⽰例example_02-01: body { background-color: grey; } @media screen and (min-width: 320px) { body { background-color: green; } } @media screen and (min-width...
View in text
Excerpt 2
oter { background-color: #BD4932; } 浏览器渲染效果如下: 使⽤Flexbox可以实现⽆数种可能的布局,⽽且得益于其“伸缩性”,这种布 局机制⾮常适合响应式设计。如果此前你从未⽤过Flexbox,可能会觉得这 些新属性和值有点奇怪,但使⽤它们却可以轻易实现以往⾮常⿇烦才能实 现的...
View in text
Excerpt 3
在HTML5中,只要⼀对<video></video> (或<audio></audio> )标 签就可以了。也可以在这对标签中间添加⽂本,以便出问题时让⽤户知道 这⾥是什么。当然,还有⼀些属性是通常都需要添加的,⽐如width 和 height : <video src="myVideo.mp4" width=...
View in text
Excerpt 4
把多个值在代码中堆起来会在使⽤版本控制系统时带来极⼤的便利。 这会让你轻易地看出两个⽂件版本的差别。这就是我为什么习惯把选 择器⼀个接⼀个堆起来。 6.2.3 阴影尺⼨ ⽼实说,多年来我都不太理解“阴影尺⼨”这⼀词的意思。我并不觉得“尺 ⼨”(spread)这个名字⽐较贴切。我更偏向于使⽤偏移。让我解释⼀下。 观...
View in text
Excerpt 5
星形会完成⼀次耗时两秒的旋 转。 要注意SVG上的transform-origin 被设置为50% 50% 。这是因为 与CSS不同,SVG默认的transform-origin 不是50% 50% (元素 的正中间),⽽是0 0 (元素的左上⾓)。如果不指定该属性,星形 会围绕左上⾓进⾏旋转。 仅仅⽤CSS的a...
View in text
Excerpt 6
拆开来讲。表单中的三块⼦ 区域都是⽤带有legend 标签的fieldset 标签包裹的: <fieldset> <legend>About the offending film (part 1 of 3)</legend> <div> <label for="film">The film in question...
View in text
Excerpt 7
u-toggle ),⽽另⼀个则是JavaScript钩⼦(js-activate-off-canvas-menu )。另外,我们使⽤了aria-label 属性(第4章详细介绍过ARIA)来告 诉屏幕读取器span 元素中字符的意义。在本例中,我们使⽤了&#9976 ; 这是⼀个Unicode字符,代表了⼋卦中...
View in text
Tags
AI categories
Web TechnologyHTMLCSS
ISBN: 7115446555
Publish Year: 2017
Language: English
File Format: PDF
File Size: 8.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…