First of all, the transition attribute IE9 is not supported, starting with IE10 support
The example is when the mouse moves over the DIV, it rotates 180 degrees.
Points:
- Make round boxes with rounded corners,
border-radius
set to 50%;
- with Box-shadow to make the fill filled with the effect, Box-shadow has 6 parameters
-
-
- blur distance (px);
- shadow size (px);
- shadow color;
- outer Shadow (outset, default) or internal (inset);
-
transition
animate, the icon in the round box is also followed by 180 degrees
-note that if an element has more than one animation, transition
can only be used once, otherwise the following will overwrite the front, then you can write multiple styles in a transition
, and then separated by commas
<style>
.box{
width: 100px;
height: 100px;
border - radius : Span style= "color: #195f91;" >50 %; //this rounded corner takes up 50% wide and becomes a circle
box - shadow : 0 0 1px black inset ;
position: relative;
transition:Box-Shadow0.2sLinear0s,Transform0.2sLinear0s; //write multiple styles in a transition and then separate them with commas .
}
box : hover {
box - shadow : 0 0 50px black inset ;
transform: rotate(180deg);
}
.icon{
height: 20%;
: 20 %;
background : URL ( 3.jpg ) no Span style= "color: #93a1a1; Font-weight:bold; " >-
position: absolute;
top: 40px;
left: 40px;
}
</style>
<script>
</script>
<body>
<div class="box">
<div class="icon"></div>
</div>
</body>
CSS3 Foundation Instance 2-box-shadow, Border-radius circle icon and internal rotation