Examples of CSS Filter (9) Wave attributes

Source: Internet
Author: User

The Wave attribute is used to disrupt objects according to vertical ripple styles. Its expression is as follows:
Filter: Wave (Add = True (False), Freq = frequency, LightStrength = enhanced light efficiency,
Phase = Offset, Strength = intensity)
We can see that the expression of the Wave attribute is still relatively complex. It has five parameters. The Add parameter has two values: True indicates that the object is disrupted according to the ripple style; False indicates that the object is not disrupted;
The Freq parameter refers to the frequency of ripple generation, that is, the number of complete ripple to be generated on the object.
The LightStrength parameter is used to enhance the effect of the generated ripple. The parameter value ranges from 0 to 100.
The Phase parameter is used to set the offset at the beginning of the sine wave. The general value of this value is 0, and its variable range is from 0 to 100. This value indicates the percentage of the starting offset to the wavelength. For example, if the value is 25, the sine wave starts from 90 degrees (360 * 25%.
Let's take a look at an instance. For example, the image below:

The following code adds the Wave effect to the above page:

The code is as follows: Copy code
<Html>
<Head>
<Title> wave css </title>
<Style> // * define the CSS style to start *//
<! --
. Leaf {position: absolute; top: 10; width: 300;
Filter: wave (add = true, freq = 3, lightstrength = 100,
Phase = 45, strength = 20 );}
// * Set the leaf style, absolute positioning, and wave attributes to generate 3 ripple, with a intensity of 100 and ripple
Starting from 162 degrees (360 * 45%), the amplitude is 20 *//
Img {position: absolute; top: 110; left: 40;
Filter: wave (add = true, freq = 3, lightstrength = 100,
Phase = 25, strength = 5 );}
// * Set the IMG style, absolute positioning, and wave attributes to generate 3 ripple, with a intensity of 100 and ripple from
Starts at 90 degrees and the amplitude is 5 *//
-->
</Style>
</Head>
<Body>
<Div class = "wave"> // * defines the DIV area as a Wave class *//
<P style = "font-family: lucida handwriting;
Font-size = 72pt; font-weight: bold;
Color: rgb (189,1, 64); "> Leaf </p>
// * Set the font name, size, width, and color *//
</Div>
<P> </p> // * import an image *//
</Body>
</Html>

If you change the Wave parameter at will, it will achieve a variety of effects, please see another effect: (as shown in the figure below ):
In fact, this effect only increases the value of the freq parameter and reduces the value of Strength and LightStrength. You can also try to change other parameter values to achieve many different effects.

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.