Pure CSS to achieve the light effect of the picture, high-force grid image display

Source: Internet
Author: User

Not to mention technology, see the effect of implementation, and the original (left) compared to the ' light ' irradiation (right) under the younger sister is not more attractive!!

Then let's talk about the technology implementation process that everyone cares about.

In fact, this is my CSS property mix-blend-mode When I came up with the implementation of the image, the following first introduced Mix-blend-mode this attribute, "Blend-mode" is the meaning of mixed mode, The CSS property function is to "mix" the element content with the background of the element and the following elements.

attribute values and their effects are as follows:

1Mix-blend-mode:normal;//Normal2mix-blend-mode:multiply;//Multiply3Mix-blend-mode:screen;//Color Filter4Mix-blend-mode:overlay;//Overlay5Mix-blend-mode:darken;// Darken6Mix-blend-mode:lighten;//Lighten7Mix-blend-mode:color-dodge;//Color Dodge8Mix-blend-mode:color-burn;//Color Burn9Mix-blend-mode:hard-light;//Strong LightTenMix-blend-mode:soft-light;//Soft Light OneMix-blend-mode:difference;//Difference Value AMix-blend-mode:exclusion;//Exclude -Mix-blend-mode:hue;//Hue -Mix-blend-mode:saturation;//Saturation Level theMix-blend-mode:color;//Color -mix-blend-mode:luminosity;//Brightness -  -mix-blend-mode:initial;//Initial +Mix-blend-mode:inherit;//Inheritance -Mix-blend-mode:unset;//Restoration

The implementation of this effect is composed of the upper left and (transparent background).

So, the Mix-blend-mode value used here is overlay. The code is as follows:

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title>Document</title>67<style>8*{padding:0;margin:0;}9 . beauty{Ten height:1000px; One width:667px; ABackground-image:url (./beauty.jpg); -border-radius:100%; - position:relative; theTransform:scale (0.5); -     } - . Beauty img{ -height:200%; +width:200%; -mix-blend-Mode:overlay; + Position:absolute; Atop:-90%; atleft:-105%; -     } -</style> -<body> -<div class= ' Beauty ' > - in</div> -</body> to<script> +</script> -

Let the two pictures overlap, and then set the blending method to overlap, it's that simple! Ha ha!

Students who want the original material can leave the mailbox, I will send you

Pure CSS to achieve the light effect of the picture, high-force picture display

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.