The Mask filter can create a rectangular mask for the HTML element object on the web page. What is a mask? If you have used masks in Flash, you will know that it is like that. In fact, you can also understand masking in this way, which is equivalent to covering the object with a piece of colored cloth, but the content is dug out. If you still don’t understand, just look at the picture below and let me explain it to you in detail.
Figure 1 Mask filter effect 1
Use such a dark color in the mask filter above , mainly so that you can clearly see the effect. Let's take a look at the parameters of the mask filter: It has only one parameter Color, which is the color value of the mask in the format of #RRGGBB. You just need to choose a suitable color for it in DW3. For example, the mask filter code above is: .mask1 { filter:mask(color=#00ff00) }. In the following example, you will see, In fact, the color of the filter is not the main thing, the key is the color of the background.
Next we use the mask filter to create several special effects:
1. Colorful text
Figure 2 mask Filter Effect 2
How about the above effect? It’s not bad! It's a bit like an image, isn't it? This is the effect of the mask filter. A white filter is used here, and its code is: .mask1 { filter:mask(color=#ffffff) }. The colorful text color is actually the color of the background. The production method is also very simple, just insert a 1*1 table, add a multi-colored background to the table, enter text in the table, load a mask filter to the cell, and you are done. Not difficult, right? !
2. Searchlight animation effect
The following searchlight effect requires a lot of effort to use Flash, but I never thought it could be done using CSS filters! Since the searchlight effect is dynamic, I can only capture two process pictures for you to see. If you want to see the dynamic effect, then you can make one according to what I said or go to my house (http://fym888.go.163.com) look.
Figure 3 Searchlight animation effect 1
Figure 4 Searchlight animation effect 2
Here is the production method:
This effect is a little more complicated than the above example, but it only requires a few more mouse clicks.
1. Insert a layer, which I call the "parent layer". This layer is used to place the content (text or pictures) to be displayed. Insert a layer on top of this layer, which I call a sublayer, and it's mainly used to create a masking effect.
2. Set the display window on the property panel of the parent layer, that is, set the "Clip" attribute of the layer. In this attribute, relative coordinates are used, where: L and T are the coordinates of the upper left corner; R and B is the coordinate of the lower right corner. Subsequent sublayers will only be displayed in the window you set.The set layer attribute parameter panel is as shown below:
Figure 5 Layer attribute panel
Here I am The parent layer is "Layer4". I use the entire parent layer as the display window here, that is, it is visible when the child layer moves to the parent layer, and is not visible outside the parent layer.
3. We insert a circular image with a transparent background on the sub-layer. The main purpose of using a circular image here is that the projection of the searchlight is like a circle. In addition, the image part outside the circle must be transparent, otherwise the visible It will be a rectangular box moving. Then load a mask filter with the same color as the background color of the parent layer on the child layer, and enlarge the child layer so that it can completely cover the content of the parent layer, so that the content on the parent layer in the browser will only be circular. That part of the image is visible, which is exactly what we want.
4. Of course, if you want to produce the effect of a searchlight, you need to make the circular area move. This requires using the Timeline function of Dreamweaver. In DW3, first drag to the sub-layer so that the picture on it just covers the head of the parent layer content. Press "Ctrl F9" to bring up the timeline panel, drag the sub-layer to the timeline panel, and drag the last frame to 100 frames, then insert a key frame at the 50th frame, and overlap the sub-layer picture with the tail of the parent layer content, select "Loop" (loop play) and "Auto" (automatic play) on the timeline panel, everything OK.
A complex animation is completed. Press F12 to take a look. Isn’t it cool? !

In this week's roundup: Firefox gains locksmith-like powers, Samsung's Galaxy Store starts supporting Progressive Web Apps, CSS Subgrid is shipping in Firefox

In this week's roundup: Internet Explorer finds its way into Edge, Google Search Console touts a new speed report, and Firefox gives Facebook's notification

You’re probably already at least a little familiar with CSS variables. If not, here’s a two-second overview: they are really called custom properties, you set

Building websites is programming. Writing HTML and CSS is programming. I am a programmer, and if you're here, reading CSS-Tricks, chances are you're a

Here's what I'd like you to know upfront: this is a hard problem. If you've landed here because you're hoping to be pointed at a tool you can run that tells

Picture-in-Picture made its first appearance on the web in the Safari browser with the release of macOS Sierra in 2016. It made it possible for a user to pop

Gatsby does a great job processing and handling images. For example, it helps you save time with image optimization because you don’t have to manually

I learned something about percentage-based (%) padding today that I had totally wrong in my head! I always thought that percentage padding was based on the


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.