What you don't know about HTML5 and the things in the HTML (v)--web image

Source: Internet
Author: User



Article Introduction: Now the page, generally inseparable from the image, and how to make our page in the image loading fast and good? What else do you not know when optimizing the page speed? Let's take a look at what I've brought to you today about Web images that you don't usually care about, and some constructive suggestions: 1) What are some of the key points you need to focus on in your Web page? 2) What should I pay attention to in the format selection of the images in Web pages? 3) Summary of usage details of tags?   The first one.
What are some of the key points you need to focus on in your Web page?
                                 &NBS P                          ,         &NB Sp         example diagram       like the picture in the example diagram, usually we write the page will use the picture, and you look at the picture when you look at the picture of what (do not say only see the S-shaped curve of beauty oh)? How do you think about the use of images when you are using them? Have you ever thought about the optimal state of this image for your page? And when you choose some pictures, you are thinking from those aspects?         Let's talk about some of the key points you should be aware of when using images:        1. Image format                 This may all be known but not necessarily know when to use what format is best, the next question will be detailed;        2. Color of the picture                 This is something you might know about the color value display of a picture, and the computer's display can display millions of colors, However, the color of the picture will be different depending on its format and the color value can be expressed, for example: PNG-8 only has 256 colors;        3. Image size and resolution         & nbsp       This is not the concept of the resolution on the paper, the size of the image you want to use, and the size of the display screen is not a factor, but also related to the screen resolution;        4. Loading speed of images                 This is really too important for the user, if a page is opened for more than three seconds without a picture display, The user's experience on this site will be large to the low;  surface loading speed on the direct element is the size of the picture, nearúdtoúd large load time nearúdtoúd long;        5. Transparency of images

Generally in the user a good user interaction experience when there is a transparent picture is better than no transparency, such as: Some of the icons are mostly used with transparency;

6. The animation of the picture this effect is on the paper you are far from invisible (the kind of the page of the flip of the words do not say), this kind of image can be a GIF format of the picture, but now in order to improve the speed is generally used flash,css,javascript to create animation, but recently with flash Also nearúdtoúd to nearúdtoúd less (Apple on the issue of the promotion of HTML), so now the main creation of animation is mainly CSS and JavaScript;   A second question What do I need to note about the format selection of the images in Web pages?
About the format of a picture in a Web page now most browsers, or screen readers, support three different formats: Png\jpg\gif;     The choice of the three format is very doorway, to learn the correct choice of these three formats, you need to first understand the characteristics of this three format; PNG: Commonly used PNG format pictures are divided into png-8 and png-24, usually this format is used to save a large number of solid color patterns or logo class files, for the continuous repetition of the pattern of his compression effect is better, and he supports the image transparency (alpha) see the above icon PNG compression is lossless compression; JPG: Suitable for color photos, because he contains a large number of colors and reasonable compression, so that the file becomes smaller, but he is a lossy compression, some pixels can not be restored after compression But it is worthwhile for the page to sacrifice some pixels because it can increase the speed; For example, the beautiful woman in the image, he is using the JPG format of the picture, the reasonable compression, the speed of loading, the effect is still acceptable; GIF: His greatest feature is the ability to make dynamic pictures, is small animation,      The left and right arrows in the example diagram are in GIF format; He also supports transparency, but does not support translucency like PNG, so it is necessary to use PNG for transparency instead of GIF in some more complex graphs, so as not to produce jagged effects; Know their characteristics can be adapted to local conditions to choose a reasonable format to encapsulate the picture file, here you can use PS to do a simple processing; Yes, there is a very important way to faster browser image loading speed, it is possible to divide a picture into several parts to save after the assembly with CSS, and the saved parts can be based on the contents of the picture file to select the format of the corresponding file to save, in order to achieve within the controllable range, the speed of the best ; A third question Summary of Usage details for tags?     As long as people who have done the development of the page know that as long as the image is loaded into the page, the standard usage is to use the tag (now do some effects with css+div); about IMG Usage I won't say it here. Here is a brief summary of the use of this label when we need to pay attention to the problem: 1. The image loaded by IMG must not be too big, That will greatly affect the speed of your page and the user's experience, so it is necessary to compress the image (images that need to be accessed must be placed on the server so that visitors can access them) 2. Provide text explanations for your IMG tags, Because some of the internet is not good to use the browser to choose to turn off the function of the image display, if you do not do the text interpretation of the image when you do not show your site is meaningless; the use of the text hint standard is the alt attribute; In theory, the text is not limited in length, but the General browser does not wrap itself. So it is best to control the user experience within 50 characters; 3. In HTML5 the IMG tag must use the ALT attribute, this must remember oh, not accustomed to the IMG tag alt attribute needs attention; 4. About the size of the image, Although you can develop the width of the IMG tag to modify the original image display size, but in the browser request when the size of the image will not change, so the suggestion is how much the page needs to be a picture of how large the image should not be modified by the width and height of the IMG tag;        OK, let's talk about it today, do you have any help in reading this article? I believe that through this article you have a new understanding of the image selection of Web pages;
in the next article I will talk about some HTML5 related to links oh, I believe there will be something you do not know. Thank you for your reading and look forward to seeing you next time. As an IT technician hone their technology is essential, concern number Coder_online, programmer Interaction Alliance, can chat with Daniel online at any time to discuss their interest in the topic, so that they spend the least time to learn the most things, I am in the Programmer Interaction Alliance look forward to your joining
 

What you don't know about HTML5 and the things in the HTML (v)--web image

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.