Home Web Front-end CSS Tutorial Simple example of css3 filtering effect

Simple example of css3 filtering effect

Mar 04, 2017 am 10:41 AM
css3 filter

The following editor will bring you a simple example of css3 filtering effect. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.

Simple example of css3 filtering effect

The picture above is the filter effect of the new features of CSS3. After learning this, we, the big web people who love beauty and handsomeness, will Isn’t it possible to perfectly beautify photos with code?~~

Okay, let’s first implement the white frame behind the photo,

<style>
#p1{   

          /*给p定义宽高和颜色*/   


          width: 200px;   
          height: 250px;   
          background: white;    

         /* 内填充距离照片为15px ,文字居中*/   
          padding: 15px;   

          text-align: center;   

      /*  把白色背景旋转-10deg  */   

          -webkit-transform: rotate(-10deg);   

      /*给背景一个阴影的效果*/   
          box-shadow: 4px 4px 4px #666;   
          float: left;   
          }   



</style>
<BR>
<body><BR>
<p id="p1">
<img  src="/static/imghw/default1.png"  data-src="img/001V28Mwty6Fww02IiNad&690.jpg"  class="lazy"   alt="Simple example of css3 filtering effect" >
<p>灰色滤镜</p>
</p>
<BR>
</body>
Copy after login

put the white background frame After writing it, it’s time to filter it

First come to the first picture, artistic black and white

#p1 img{   

/*把p1里面的图片百分百,等同于相对于在p1里面百分比放大填充*/   
width: 100%;          
/*把图片变成黑白色括号里跟颜色变化的值,只能取0~1之间*/    
-webkit-filter: grayscale(1);   }
Copy after login

The second picture, uh... Old photos.

#p1 img{   
            width: 100%;   
            -webkit-filter: sepia(1);   
        }
Copy after login

The third photo, reverse color? I’m not sure what color it is either

#p1 img{   
            width: 100%;   
            -webkit-filter: hue-rotate(200deg);   
        }
Copy after login

The fourth photo seems to be covered with a layer of white mist

#p1 img{   
            width: 100%;   
            -webkit-filter: opacity(0.5);   
        }
Copy after login

There is another photo It’s not on the renderings, but the blur effect code is as follows

#p4 img{   
            width: 100%;   
            -webkit-filter: opacity(0.5);   
        }
Copy after login

Okay, I’ve finished sharing my filter, and the next step is to go to the beautiful picture

The above css3 The simple example of filtering effect is all the content shared by the editor. I hope it can give you a reference, and I hope you will support the PHP Chinese website.

For more simple examples of css3 filtering effects and related articles, please pay attention to the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to achieve wave effect with pure CSS3? (code example) How to achieve wave effect with pure CSS3? (code example) Jun 28, 2022 pm 01:39 PM

How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!

Use CSS skillfully to realize various strange-shaped buttons (with code) Use CSS skillfully to realize various strange-shaped buttons (with code) Jul 19, 2022 am 11:28 AM

This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!

How to hide elements in css without taking up space How to hide elements in css without taking up space Jun 01, 2022 pm 07:15 PM

Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.

Python implements XML data filtering and filtering Python implements XML data filtering and filtering Aug 09, 2023 am 10:13 AM

Python implements XML data filtering and filtering. XML (eXtensibleMarkupLanguage) is a markup language used to store and transmit data. It is flexible and scalable and is often used for data exchange between different systems. When processing XML data, we often need to filter and filter it to extract the information we need. This article will introduce how to use Python to filter and filter XML data. Import the required modules Before starting, we

How to open filtered duplicate files in Quark How to open filtered duplicate files in Quark Mar 01, 2024 am 11:25 AM

When using Quark Browser, there is a function to filter duplicate files. Some friends are not very familiar with this. Here I will introduce how to turn on this function. If you are interested, come and take a look with me. 1. First, click "Quark Browser" on your mobile phone to enter the interface, then click and select "Quark Network Disk" in the options in the middle of the page to open and enter. 2. Find "Backup Settings" in the lower part of the Quark network disk interface, and click to open it, as shown in the figure below: 3. Next, on the page you enter, there is a "Filter Duplicate Files", which is displayed behind it There is a switch button. Click the circular slider on it and set it to color to turn on this function. When you continue to back up files, duplicate files will be skipped to save network disk capacity.

How to use PHP functions to search and filter data? How to use PHP functions to search and filter data? Jul 24, 2023 am 08:01 AM

How to use PHP functions to search and filter data? In the process of developing using PHP, it is often necessary to search and filter data. PHP provides a wealth of functions and methods to help us achieve these operations. This article will introduce some commonly used PHP functions and techniques to help you search and filter data efficiently. String search Commonly used string search functions in PHP are strpos() and strstr(). strpos() is used to find the position of a certain substring in a string. If it exists, it returns

How to implement lace borders in css3 How to implement lace borders in css3 Sep 16, 2022 pm 07:11 PM

In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".

It turns out that text carousel and image carousel can also be realized using pure CSS! It turns out that text carousel and image carousel can also be realized using pure CSS! Jun 10, 2022 pm 01:00 PM

How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!

See all articles