[笔记]html5+css3 响应式设计(RWD,Responsive Web Design)

本文详细介绍了响应式网页设计的概念,包括Ethan Marcotte提出的响应式设计思想,以及如何通过html5和css3实现响应式设计。重点讲述了媒体查询的使用,以及流式布局和弹性图片的方法。此外,还提到了使用百分比布局和em单位来实现布局的灵活性,并介绍了Respond.js等工具来解决低版本浏览器的兼容性问题。最后,强调了响应式设计的三大要素:媒体查询、流式布局和弹性图片,并提及HTML5和CSS3在响应式设计中的作用。
摘要由CSDN通过智能技术生成

[笔记]html5+css3 响应式设计(RWD,Responsive Web Design)[概述+媒体查询]
书名:<Web设计:HTML5和CSS3实战>
一 概述
1. 为了能够使「一个页面,支持各种客户端屏幕分辨率大小[pc,mobile,pad]」成为可能,Ethan Marcotte提出了响应式网页设计。
将3种已有的开发技巧【弹性网格布局,弹性图片,媒体和媒体查询】整合后,命名为【响应式网页设计(流式设计,弹性布局,塑料布局,流体设计,自适应布局,跨设备设计,弹性设计)】
2. 一句话概括:针对【任意设备】对【网页内容】进行【完美布局】的一种显示机制。
3. html5语义标签和css3字体,动画,变换等功能,给RWD提供了更多可能性
4. 不再迷恋 【像素px】,使用相对度量单位【em或百分比】
5. 视口(ViewPort):页面实际显示区域
屏幕尺寸:设备物理显示区域
6. 【响应式网站】无法替代真正的【移动网站】

二 媒体查询
根据设备显示器特性【视口宽度,屏幕比例,设备方向】设定css样式
1. 使用
1-1) css文件:
@media screen and (max-width: 960px){
body{
background-color: red;
}
}
1-2) <link>标签:
<link rel="stylesheet" type="text/css" media="screen" href="xxx.css">
<link rel="stylesheet" type="text/css" media="screen and ( orientation: portrait) and (min-width: 800px), projection" href="xxx.css">
纵向的宽度大于800px的屏幕或投影仪的时候,加载xxx.css
1-3) css文件里的import
@import url("xxx.css") screen and (max-width:360px); 会增加http请求,影响加载速度

2 可检测特性
width[视口宽度],height[视口高度],device-width[屏幕宽度],device-height[屏幕高度],orientation[屏幕纵横],aspect-ratio[视口宽高比16:9=16/9],device-aspect-ratio[屏幕宽高比],color[xx位色min-color: 16],

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Design and deliver an optimal user experience for all devices About This Book Get to grips with the core functionality of RWD through examples Discover how to make layouts, content and media flexible, and explore why a content-first approach is more effective Maximize the performance of your web pages so that they work across all browsers and devices irrespective of the screen size Who This Book Is For This book is for web designers who are familiar with HTML and CSS, and want to begin with responsive web design. Web development experience and knowledge of HTML5, CSS3 is assumed. What You Will Learn Explore various layout options Understand what can be achieved in the browser, without the use of third-party tools Executing media queries to benefit responsive designs Understand the basics of responsive workflow and boilerplate frameworks Improve performance of responsive web design Maintain compatibility across various browsers In Detail Responsive web design (RWD) is a web design approach aimed at crafting sites to provide an optimal viewing and interaction experience - providing easy reading and navigation with minimum resizing, panning, and scrolling - and all of this across a wide range of devices from desktop computer monitors to mobile phones. Responsive web design is becoming more important as the amount of mobile traffic now accounts for more than half of the Internet’s total traffic. This book will give you in depth knowledge about the basics of responsive web design. You will embark on a journey of building effective responsive web pages that work across a range of devices, from mobile phones to smart TVs, with nothing more than standard markup and styling techniques. You'll begin by getting an understanding of what RWD is and its significance to the modern web. Building on the basics, you'll learn about layouts and media queries. Following this, we’ll dive into creating layouts using grid based Table of Contents Chapter 1: Introducing Responsive Web Design Chapter 2: Creating Fluid Layouts Chapter 3: Adding Responsive Media Chapter 4: Exploring Media Queries Chapter 5: Testing and Optimizing for Performance
If you think you need to create a "mobile" version of your website—think again! A responsive web design provides one design that looks great on smart phone, desktop, and everything in-between. It will effortlessly respond to the size of the user's screen, providing the best experience possible for both today's and tomorrow's devices. This book provides a complete "how-to" of taking an existing fixed width design and making it responsive. Furthermore, it extends responsive design methodology by applying the latest and most useful techniques provided by HTML5 and CSS3, making the design leaner and more maintainable than ever before. It also explains common best-practice methods of writing and delivering code, images, and files. If you can understand HTML and CSS, you can build a responsive web design. What you need for this book You'll need a good familiarity with HTML and CSS. A very basic understanding of JavaScript may also help. A good taste in films will also be beneficial. Who this book is for Are you writing two websites—one for mobile and one for larger displays? Or perhaps you've heard of "responsive design" but are unsure how to bring HTML5, CSS3, and responsive design together. If so, this book provides everything you need to take your web pages to the next level—before all your competitors do! This book is aimed at web designers and web developers who currently build fixed-width websites with HTML 4.01 and CSS 2.1. This book explains how to build responsive websites with HTML5 and CSS3 that adapt to any screen size.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值