CSS implementation picture is not loaded when the placeholder display instance sharing

Source: Internet
Author: User
Through the CSS control, can be implemented when loading the network picture, not loaded when the completion of the display of a local image of the bitmap, loading completed display network pictures;

Principle: Add a bitmap to the after pseudo element of the IMG tag, and IMG is set to Position:relative;after to set the SRC for the Position:absolute;img label as a network picture, This loading time because the network picture does not load complete, will display the local picture, the following case of JS is for obvious effect and deliberately delay set img src attribute.

<! DOCTYPE html>

End-of-text benefits:

Welfare one: front-end, Java, product Manager, applet, Python and other resources collection Big broadcast: https://www.jianshu.com/p/e8197d4d9880
Welfare II: Introduction to small procedures and actual combat full set of detailed video tutorial: https://www.jianshu.com/p/e8197d4d9880




Related Article

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.