Home Web Front-end HTML Tutorial Proficient in the use of CSS DIV web page styles and layout filters_html/css_WEB-ITnose

Proficient in the use of CSS DIV web page styles and layout filters_html/css_WEB-ITnose

Jun 24, 2016 am 11:50 AM

In the last blog, the editor briefly introduced the use of CSS and how to create practical menus. Today we continue to summarize the basic knowledge about CSS. Today the editor briefly introduces the basics of CSS. The use of filters. First of all, the editor will briefly introduce filters. This time we will talk about the use of filters. First of all, the editor will briefly introduce the concept of filters. CSS filters are not browsers. The plug-ins do not comply with CSS standards. Secondly, they are a collection of tired functions specially developed by Microsoft to enhance browser functions and integrated into IE browser. Since the browser IE has a wide range of uses, CSS filters are also loved by designers. The logo of the CSS filter is "Filter". Generally, it is very simple as other CSS statements. Then, let's take a look at a mind map:

Then, Xiaobian Following the context of the above mind map, let’s briefly introduce it in turn. First, let’s take a look at the Alpha channel. Let’s look at the example code and running effects:

Alpha channel

<span style="font-size:18px;"><span style="font-size:18px;"><html><head><title>alpha滤镜</title><style><!--body{	background:url(bg1.jpg);	margin:20px;}img{	border:1px solid #d58000;}.alpha{	filter:alpha(opacity=50);}--></style>   </head><body><img src="building1.jpg" border="0">  <img src="building1.jpg" border="0" class="alpha"></body></html></span></span>
Copy after login

The running effect is as follows:

The effect is even stronger. Let's look at the CSS code: here we put filter:alpha(opacity=20); of course, you can set different values ​​yourself to see the display effect. Let's look at blur next. We can create a blurry effect without using photoshop. Let’s take a look at the example code and the running effect:

Blur blur

The running effect is as follows:

<span style="font-size:18px;"><span style="font-size:18px;"><html><head><title>Blur滤镜</title><style><!--body{	margin:10px;}.blur{	filter:progid:DXImageTransform.Microsoft.blur(pixelradius=4,makeshadow=false);}--></style>   </head><body><img src="building9.jpg"> <img src="building9.jpg" class="blur"></body></html></span></span>
Copy after login

Let’s analyze the above example and compare the two pictures. The second picture uses class="blur". We see this sentence filter:progid:DXImageTransform.Microsoft.blur(pixelradius=4,makeshadow=false ); Here we set the blur effect

pixelradius to different values, and you can see different blur effects. You can try it yourself. Let's look at the transparent color filter next. Let's look at the example code and running effect:

Transparent color

The running effect is as follows:

<span style="font-size:18px;"><span style="font-size:18px;"><html><head><title>chroma滤镜</title><style><!--body{	margin:10px;}.chroma{	filter:chroma(color=FF6800);		/* 去掉金黄色 */}--></style>   </head><body> <img src="tiger.gif">  <img src="tiger.gif" class="chroma"></body></html></span></span>
Copy after login

Analyze the above examples, we clearly see that the golden yellow on the tiger is filtered. We read this sentence: Filter: chroma (color = ff6800); Remove the yellow color. Let’s continue looking at the flip filter. CSS can flip the image without processing the image. See the example code and running effect below:


Flip flip

<span style="font-size:18px;"><span style="font-size:18px;"><html><head><title>Flip翻转</title><style><!--body{	margin:12px;	background:#000000;}.flip1{	filter:fliph;	/* 水平翻转 */}.flip2{	filter:flipv;	/* 竖直翻转 */}.flip3{	filter:flipv fliph;	/* 水平、竖直同时翻转 */}--></style>   </head><body><img src="building4.jpg"><img src="building4.jpg" class="flip1"><br><img src="building4.jpg" class="flip2"><img src="building4.jpg" class="flip3"></body></html></span></span>
Copy after login

The running effect is as follows:

Analyze the above example. Here are actually four pictures. The first one (upper left corner) is the original film; the second picture is processed. The horizontal image is mirrored vertically in the third one; while the lower right corner is mirrored both horizontally and vertically. Let's take a look at the code: We can also see from the code that flip1 has been flipped horizontally. Let's continue to look at the mask. Photoshop has a powerful mask function. Let's look at the example code and running effect:


Mask

<span style="font-size:18px;"><html><head><title>Mask遮罩</title><style><!--body{	margin:12px;	background:#000000;}.mask{	filter:mask(color=#FF0000);	/* 遮罩效果 */}--></style>   </head><body>	<img src="muma.gif"> 	<img src="muma.gif" class="mask"></body></html></span>
Copy after login


The running effect is as follows:

Analyzing the above example, we see that the second picture is a bit like a shadow changing effect. Let's take a look at the CSS code. In our code, the first picture is not processed, and the second picture is masked. . Let’s look at this sentence: filter:mask(color=RED); This is the color that needs to be masked. Let’s continue to look at the best filter, the wave filter. We often use photoshop to achieve the wave effect. CSS can also be used. Let’s take a look at the example code and running effect:


The running effect is as follows :

<span style="font-size:18px;"><html><head><title>Wave波浪滤镜</title><style><!--body{	margin:12px;	background-color:#e4f1ff;}span{	font-family:Arial, Helvetica, sans-serif;	height:100px; font-size:80px;	font-weight:bold;	color:#50a6ff;}span.wave1{		filter:wave(add=0,freq=2,lightstrength=70,phase=75,strength=4);}span.wave2{		filter:wave(add=0,freq=4,lightstrength=20,phase=25,strength=5);}span.wave3{		filter:wave(add=1,freq=4,lightstrength=60,phase=0,strength=6);}--></style>   </head><body>	<span class="wave1">波浪Wave</span>	<span class="wave2">波浪Wave</span>	<span class="wave3">波浪Wave</span></body></html></span>
Copy after login

Analyze the above example. Each of the three paragraphs of text here uses a wave effect:


(add=0,freq=2, lightstrength=70, phase=75, strength=4), the expressed frequency is 2, and the final degree is 4. Finally, let’s look at a comprehensive example. What kind of magical effect will there be when three filters are used together? Example The code and running effect are as follows:

The running effect is as follows:

<span style="font-size:18px;"><html><head><title>三个滤镜同时使用</title><style><!--body{	margin:12px;	background:#000000;}.three{	filter:flipv alpha(opacity=80) wave(add=0, freq=15, lightstrength=30, phase=0, strength=4);	/* 同时使用三个滤镜 */	/* 竖直翻转、透明、波浪效果 */}--></style>   </head><body>	<img src="lotus.jpg"><br>	<img src="lotus.jpg" class="three"></body></html></span>
Copy after login

Message from the editor: In this blog post, the editor briefly introduces the relevant knowledge points about filters in CSS, including Alpha channel, Blur, transparent color, etc., the last one A small example, three filters are used at the same time. If you want to make the effect more beautiful and colorful, the editor still recommends using Photoshop. After all, the display effects of these small examples are different in various browsers. BS learning, To be continued...

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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1276
29
C# Tutorial
1256
24
HTML: The Structure, CSS: The Style, JavaScript: The Behavior HTML: The Structure, CSS: The Style, JavaScript: The Behavior Apr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML, CSS, and JavaScript: Web Development Trends The Future of HTML, CSS, and JavaScript: Web Development Trends Apr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: Building the Structure of Web Pages HTML: Building the Structure of Web Pages Apr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

The Future of HTML: Evolution and Trends in Web Design The Future of HTML: Evolution and Trends in Web Design Apr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative Overview HTML vs. CSS vs. JavaScript: A Comparative Overview Apr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML vs. CSS and JavaScript: Comparing Web Technologies HTML vs. CSS and JavaScript: Comparing Web Technologies Apr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML: Is It a Programming Language or Something Else? HTML: Is It a Programming Language or Something Else? Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

What is the difference between <strong>, <b> tags and <em>, <i> tags? What is the difference between <strong>, <b> tags and <em>, <i> tags? Apr 28, 2025 pm 05:42 PM

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

See all articles