The power of CSS: drawing with a div

Source: Internet
Author: User
These pictures are drawn with a div, but the principle is not complicated.


These images are drawn from CSS, implemented by Background-image overlay,

such as the implementation of the mushroom head, through the radial-gradient radial gradient, linear-gradient linear gradient superimposed on each other to achieve, such as:

p {  width:170px;  height:140px;  Background-image:        radial-gradient (circle at 50% 120%, Rgba (0,0,0,0.7) 23%, Rgba (0,0,0,0) 48%),        Linear-gradient (30deg, Rgba (0,0,0,0.4) 10%, Rgba (0,0,0,0) 20%),        radial-gradient (circle at 50% 33%, #f8f6f7 32%, Rgba (255,255,255,0) 32%),        radial-gradient (Circle at-13% 55%, #f8f6f7 20%, Rgba (255,255,255,0) 20%),        Radial-gradient (circle at 113% 55%, #f8f6f7 20%, Rgba (255,255,255,0) 20%),        linear-gradient (to bottom, #ef0015 20%, #b 2000c 100%);        border-radius:140px 140px 80px 80px;}

At the same time, there is the pass of the occlusion relationship: Before and: The background-image of After pseudo-element.

Online Demo: http://jsfiddle.net/ourjs/ed0ayybo/

PS: This approach does not fully support the old version of IE

Original address: http://a.singlep.com/?utm_source=ourjs.com

  • 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.