前端- RWD
前端- RWD
Responsive Web Design

Users are used to scroll websites vertically on both desktop and mobile devices - but not horizontally!
view port
The viewport is the user's visible area of a web page.
html5
<meta name="viewport" content="width=device-width, initial-scale=1.0">
The width=device-width
part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).
The initial-scale=1.0
part sets the initial zoom level when the page is first loaded by the browser.
media query
Always Design for Mobile First!
uses the @media
rule to include a block of CSS properties only if a certain condition is true.
eg If the browser window is 600px or smaller, the background color will be lightblue:
@media only screen and (max-width: 600px) { |
break point
@media only screen and (min-width: 600px) { |
typical breakpoints
/* Extra small devices (phones, 600px and down) */ |
Orientation
The web page will have a lightblue background if the orientation is in landscape mode:
@media only screen and (orientation: landscape) { |
framework
eg bootstrap
it uses HTML, CSS and jQuery to make responsive web pages.