Web page Implementation Insert Picture-css and HTML difference

Source: Internet
Author: User

Q1. What is the difference between the two?
A1. The images written in CSS are in the form of a background image, and the HTML is written in the form of a tag.
In the process of Web page loading, the image that exists in the CSS background will wait until the structure loading is complete (after the content of the Web page is displayed), and the tag in HTML is part of the structure (content) of the page, which is loaded in the process of loading the structure, in other words, the page will load first the contents of the tag, and then load the background image, if you introduce a large image with , then the content after, is not displayed until the image is downloaded. And if you use CSS to introduce the same image, the structure of the Web page and the content is loaded, the background image will not be loaded, and it won't affect the content of your Web browsing.

Q2. What pictures are inserted in the CSS, what pictures are inserted inside the HTML?
A2. If a decorative picture is written in the CSS, if the content of the picture is written in the HTML,
For example, you want to make a photo album with a nice border. Then the frame of the picture is written in the CSS, the picture frame inside the content is written in the HTML.


Q3. Do not know how to ask, extension Point said is better.
A3. Future Web page Design direction is the presentation layer and Content layer separation, CSS tube performance, that is, the display effect, HTML tube structure, content structure division, so that the code is simple and easy to maintain some. It is incorrect to say in other responses that "things like are discarded" and that the images in the content should be introduced using the icon instead of the CSS background. and "CSS images can be reused, pictures cannot be reused" This is also incorrect, the page loading process of the same image will be downloaded once and saved in the cache, other places use the same image will not be downloaded again. images can be reused as well.

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.