CSS Filter usage Summary

Source: Internet
Author: User

How to Use CSS filters:Filter: filtername (parameters): filter: Filter Name (parameter)

ALPHA: sets the transparency level.
Blur: Creates high-speed mobile effects, that is, blur effects.
Chroma: Make special colors transparent
Dropshadow: Creates a fixed shadow of an object.
Fliph: Create a horizontal Image
Flipv: Create a vertical image
Glow: glow outside the edge of a nearby object
Gray: Grayscale Images
Invert: reversed
Light: Creates a light source on an object.
Mask: create a transparent mask on the object
Shadow: creates an offset fixed shadow.
Wave: Ripple Effect
Xray: make the object look like X-ray

Specific ApplicationThere are two methods:
1. Define CSS first, and then use pre-defined CSS on the objects required on the page. In fact, the syntax of these filters has been set in the CSS Settings dialog box in advance, we only need to fill in the appropriate specific parameters:
2. Write CSS Filter directly on HTML control elements that support CSS Filter EffectsCode.

A, Alpha "filter:When you hear this name, you may think of flash and Photoshop. A little good, they basically play a similar role, that is, to mix a target element with the background. You can specify a value to control the degree of mixing. In general, this "mixed with the background" is the transparency of an element.

Syntax: Style = "filter: alpha (opacity = opacity, finishopacity = finishopacity, style = style, startx = startx, starty = starty, finishx = finishx, finishy = finishy )"
Note:
Opacity: start value. value range: 0 ~ 100, 0 is transparent, and 100 is the source image.
Finishopacity: target value.
Style: 1, 2, or 3
Startx: any value
Starty: any value
Example: filter: alpha (opacity = "0", finishopacity = "75", style = "2 ″)

B. filter:It is one of CSS filters. loading it to text can produce the effect of three-dimensional characters, which will bring great convenience for you to use three-dimensional words as titles on the webpage, it also reduces the size of your web page. By loading the blur filter to an image, you can increase the color of your image. Even though you can use image processing software to achieve the same effect, but it is much easier to use the blur filter.

Syntax: Style = "filter: blur (add = add, direction = direction, strength = strength )"
Note:
Add: generally 1, or 0.
Direction: angle, 0 ~ 315 degrees. The step size is 45 degrees.
Strength: the number of results that increase, generally 5.
Example: filter: blur (add = "1", direction = "45", strength = "5 ″)

C, chromaFilter:Set the color concentration of the object
Syntax: Style = "filter: chroma (color = color )"
Note: Color: # rrggbb format, any.
Example: filter: chroma (color = "# ffffff ")

D, dropshadowFilter:As the name implies, it is the shadow effect of adding objects. It looks like the original object leaves the page, and the projection of the object is displayed on the page. The working principle is to create an offset and add the color.

Syntax: Style = "filter: dropshadow (color = color, offx = offx, offy = offy, positive = positive )"
Note: Color: # rrggbb format, any.
Offx: returns the offset of the X axis.
Offy: Y-axis deviation value.
Positive: 1 or 0.
Example: filter: dropshadow (color = "# 6699cc", offx = "5", offy = "5", positive = "1 ″)

F,FliphFilter:Achieve horizontal reversal
Syntax: Style = "filter: fliph"
Example: filter: fliph
FlipvFilter:Vertical inversion of filters
Syntax: Style = "filter: flipv"
Example: filter: flipv

G,GlowFilter:When the "Glow" attribute is used for an object, the edge of the object will produce a similar luminous effect.
Syntax: Style = "filter: glow (color = color, strength = strength )"
Note:
Color: Luminous color.
Strength: intensity (0-100)
Example: filter: glow (color = "# 6699cc", strength = "5 ″)

G, GrayFilter:Use the gray filter to convert an image to a grayscale image.

Syntax: Style = "filter: Gray"
Example: filter: Gray

I, invertFilter:As the name suggests, invert objects
Syntax: Style = "filter: Invert"
Example: filter: Invert

M, maskFilter:The "Mask" attribute can be used to create a film covering the surface for the object. The effect is the same as watching the object with colored glasses.
Syntax: Style = "filter: mask (color = color )"
Example: filter: mask (color = "# ffffe0 ″)

S, shadowFilter:You can use the "shadow" attribute to create an object projection in the specified direction. color is the projection color, and direction is the projection direction. Where 0 degrees indicates vertical up, and then every 45 degrees is a unit. The default value is 270 degrees to the left.

Syntax: filter: Shadow (color = color, direction = direction)
Note:
Color: # rrggbb format.
Direction: angle, 0-degrees, step size: 45 degrees.
Example: filter: Shadow (color = "# 6699cc", direction = "135 ″)

W, wave filter:You may be able to think of the effect by looking at its name. as you think, it is used to distort the object according to the vertical waveform style, thus generating a special effect.
Syntax: filter: Wave (add = add, freq = freq, lightstrength = strength, phase = phase, strength = strength)
Note:
Add: generally 1, or 0.
Freq: deformation value.
Lightstrength: Deformation percentage.
Phase: angular deformation percentage.
Strength: deformation strength.
Example: filter: Wave (add = "0", phase = "4", freq = "5", lightstrength = "5", strength = "2 ″)

X, Xray filters:Show only the outlines of Objects
Syntax: Style = "filter: Xray"
Example: filter: Xray

from: http://www.bbon.cn/2008/05/css%E6%BB%A4%E9%95%9C%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95%E6%B1%87%E6%80%BB.html

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.