How to highlight CSS borders
When designing a webpage, we often perform special processing on some border styles to highlight the effect. Today, I will explain how to make CSS borders shine.
There is a bright light around the input box, or the shadow creates the illusion that the border is shining. This is what I call the highlighted effect. How should we implement it?
In this case, let's start with the code. I use the maple browser and webkit kernel, so here I only write webkit
The Code is as follows:
. Aa: HOVER {
-Webkit-transition: border linear. 2 s,-webkit-box-shadow linear. 5 s;
Border-color: rgba (141, 39, 142,. 75 );
-Webkit-box-shadow: 0 0 18px rgba (111,1, 32,3 );
}
. Aa {
Height: 100px; width: 100px;
}
In this case, the function is implemented in a few words, and I will not be able to figure it out. I will analyze the key points of success based on the above results:
1. transition of transition. border linear. 2s indicates the gradual transition of the border attribute, while the subsequent transition is the gradual transition of the Shadow part;
2. rgba (a, B, c, d). We have used it many times before. The first three digits are in color, while the fourth digit is in transparency, which must be kept in mind;
3. box-shadow: x y 10px rgba (a, B, c, d). It has also been used many times before. x y is the shadow direction, then there is the shadow spreading distance, and finally the color of the Shadow part;
4. In the end, it is hover. You can write an article on pseudo elements and pseudo classes separately. But we are quite familiar with hover.
This article first: Network Teaching Base original address: http://www.studynb1.com/css/84.html