Home > Web Front-end > H5 Tutorial > 9 key points of responsive web design

9 key points of responsive web design

PHPz
Release: 2017-04-03 14:43:21
Original
2229 people have browsed it

Responsive Web Design is a great solution to the multi-screen problem, but is a bit difficult from a print perspective. There are no fixed page sizes, no millimeters or inches, no physical limitations, no way to start. The exclusive use of pixel design methods for desktop and mobile is also a thing of the past, as more and more devices can open websites. Therefore, we need to clarify some of the basic principles of responsive web design and accept fluid web pages instead of fighting them. 1. Responsive vs Adaptive Web Design

They may seem to be the same, but they are not. These two methods complement each other. There is no saying which one is correct and which one is wrong. Content determines everything.

2. Content flow

As the screen size becomes smaller, the content will occupy more vertical space, and the content below will be pushed downwards. This is the so-called flow. . This can be a little tricky if you're designing with pixels and points, but once you get used to it, it will make sense.

3. Relative unit

The canvas size can be desktop, mobile or any size between them. Pixel density can also vary, so we need flexible units that can be used on a variety of screens. This is where relative units like percentages come in handy. So setting a width of 50% means it will take up half of the screen (or

View

, which is the size of the open browser window). 4. Breakpoints

Breakpoints allow layout changes at predefined points. For example: there are 3 columns on the desktop screen, but there is only one column on the mobile screen. Most CSS

properties

can be changed based on breakpoints. Typically you would set breakpoints based on specific content. If a sentence exceeds the screen length, you may want to add a breakpoint. But use breakpoints with caution—it can quickly lead to confusion when it's difficult to understand what affects what. 5. Maximum and Minimum Values

Sometimes it is good if the content takes up the entire width of the screen, such as on mobile devices. But if it's on a TV screen and the same content occupies the entire width of your screen, it usually doesn't make much sense. This is where the Min/Max values ​​come into play. For example, if

width

is set to 100%, and then max-width is 1000px, then the content will fill the screen, but will not exceed 1000px. 6. Nested

Objects

Do you remember the relative position? It is difficult to control the positioning of many elements depending on the positioning of

other

elements, so using containers to wrap elements can make it easier to understand and tidier. This is where static units (such as pixels) come into play. They are useful for content that you don't want modular (like a logo or a button). 7.Mobile or Desktop priority

Technically, if a project starts with a smaller screen and becomes a larger screen (mobile first), or vice versa (Desktop takes precedence), there is not much difference. However, it adds additional restrictions that can help you decide whether to start with mobile first. Usually everyone writes both ends together at the beginning, so it’s better to see which one runs better.

8. Web Fonts vs System Fonts

Wish you had a cool Futura or Didot font on your website? Web fonts are available! While they look great, remember that the more fonts you put in, the longer your page will take to load. On the other hand, loading system fonts is lightning fast, but when the user doesn't have the set of fonts locally, it falls back to the default font.

9. Bitmap vs

Vector image

Have you ever thought about adding a lot of details and fancy effects to your icons? If you think about it, using bitmaps is more appropriate. If not, consider using vector graphics. For bitmaps, use images in jpg, png or gif format, while for vectors, your best choice is SVG or icon fonts. Each has corresponding advantages and disadvantages. But the size of

images

also needs attention - images on web pages must be optimized. On the other hand, vector images are usually smaller, but some older browsers do not support them. Also, it may be heavier than a bitmap if it has a lot of curves. So, choose carefully.

The above is the detailed content of 9 key points of responsive web design. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template