为大家分享了很多款纯css3实现的实用按钮。今天给大家带来一款基于css3的动画按钮。实现的效果图如下: {* y: V5 q2 k5 w/ b
/ x& ~9 ?" r( D$ Y i
实现的代码。0 a8 r6 B3 l$ B* x" v
html代码:$ e& T- r& a) N+ c2 F" o; V* I2 y7 B
xml/html code复制内容到剪贴板
( J* L8 B- l* x/ u! a% I<div class=share-buttons>
, Y. W7 u* ?2 J* `<div class=share-button>
+ n3 s" W* V4 b9 O1 S+ E9 j1 f1 r<div class=share-button-secondary>
# V% B: |1 V0 x q! M+ s<div class=share-button-secondary-content> F3 O6 n7 T4 _- [" W
share on twitter
( t3 t; f- I6 ?</div> : Q1 S, {' f/ X2 u3 w. |
</div>
! H5 O4 I$ O8 y# @$ v( C( A<div class=share-button-primary> 9 e0 L/ F/ ~% w6 `4 V
<i class=share-button-icon fa fa-twitter></i>
, C* o1 I$ r: ?; L</div> - m- j# l' J4 s) u4 d" N5 {
</div> - i `4 e5 w; B% _- d% c
<div class=share-button> V" `, ]8 }9 `6 X8 c
<div class=share-button-secondary>
; J5 m W8 K& P0 t$ x {<div class=share-button-secondary-content>
( S8 I K" W) A0 X$ z' z, a! _7 E" Y4 `share on facebook 0 y' h% b0 m" |
</div>
3 i u5 ~, G% C6 ?/ }</div>
7 J) B: e1 x! U$ R& L m<div class=share-button-primary>
9 r E3 P- z! K; z! Y, V! y9 w# T8 f+ ^<i class=share-button-icon fa fa-facebook></i>
2 p+ ~4 o4 W( f* I% u$ q6 g</div> & |! w7 N5 s" |5 V* \. z
</div>
5 V- B' _) d4 f0 p' ~9 u9 ?<div class=share-button>
- S' B9 L2 v( U2 f( c, k<div class=share-button-secondary> : C; ^* S. y( c9 S# z/ Z( a0 a' \
<div class=share-button-secondary-content> , m) Z; E( L( l7 K9 J
pin on pinterest " t K; V7 n, R
</div>
# h$ f9 S P. S' z9 p! j" S</div> 9 h! F6 z& w& U: {% b5 I: }
<div class=share-button-primary>
+ a$ Q. D8 Q7 ^2 o9 l* V<i class=share-button-icon fa fa-pinterest></i>
( v4 X- ~) [( D5 f* h6 P) h</div>
! t3 T3 T* |8 Q# _7 ^4 k0 A</div>
9 P4 ?+ A* w" x<div class=share-button>
! C. g/ N7 j' G<div class=share-button-secondary>
1 M# h# {) f% @2 [8 g<div class=share-button-secondary-content>
( j. s$ E. Z- A$ y- Ashare on tumblr
6 m) r# {! ` o6 m+ u</div>
* J- F8 J. F7 F9 u: d8 ^3 p7 R' ?</div> ; W! w8 ]1 w6 j& C" K
<div class=share-button-primary> 9 p9 |8 T' i3 ^4 B4 h. P
<i class=share-button-icon fa fa-tumblr></i>
6 K& o8 }$ l- m5 h</div>
8 e) d% m3 |; M6 D$ d" J% r</div> 0 Y% ~/ ~. o$ |. L$ I5 o0 J
<div class=share-button> + \& ?$ X$ {6 _* m6 i% g, \, s
<div class=share-button-secondary> : b% z, O1 I9 Z. ~' `. G% Z
<div class=share-button-secondary-content>
# s/ Y- q7 Z- [# E( A8 [share on google+ - ~, v% \) L+ W2 }" Z0 N
</div>
7 D; S I4 T5 [- g. U: g9 v5 a</div>
* L X; n3 r: y$ j# M, Z* |8 b<div class=share-button-primary> ; j. V2 z( B' d5 t; R" Y
<i class=share-button-icon fa fa-google-plus></i> $ r% X0 x' W# t4 Y) d
</div>
8 T1 d ~! t/ C0 E! d* K$ J* v# m- j</div> ; C; u% l6 e6 [) s: C! t8 @7 v' K
</div>
' f- k, y' V, A$ D, `css3代码:
$ b; [1 G* x) W; Icss code复制内容到剪贴板/ I( V- @) a4 V6 a$ s& T
body ' Q/ \* F7 u# A: ~
{ : H: V0 ~: E5 I* ~; }! f, r$ v6 E. A
background: -webkit-linear-gradient(0deg, #ff8008 10%, #ffc837 90%); , s# L V3 v: V% @6 x
background: linear-gradient(90deg, #ff8008 10%, #ffc837 90%); , m$ C0 N6 R+ `* J* ~+ J u3 f t
padding: 2em;
7 I1 ?8 G2 Z. a) \text-align: center;
& Y7 e# T- ]! T8 ?}
( M- A1 S/ N; X+ p B( p, q, j5 d) v A3 W0 y! }$ v
* 1 a. t% o6 S; p+ ?% S
{
* P' B2 B: z6 G* Q3 R) s$ J-moz-box-sizing: border-box; $ s' i! Z% c) k' f
box-sizing: border-box; 8 X3 P/ G+ c4 X2 U/ v" f& ~% }
} 2 e" H+ Y4 I" l: ?" s
( w: Q; {6 v7 z5 Q# J, e.share-buttons
, H7 u) M$ F5 Q7 Q/ R3 R T{ 5 s6 J r/ H0 f/ N3 a
position: absolute; 9 |+ t* b% L" p
width: 300px;
4 S& d% V# M4 `height: 212px; * ^7 m- d5 i7 j0 }
padding-left: 135px; 9 X) x# l4 ^0 q3 A) j, s
top: 50%; . @9 W4 t3 q. A/ c' y
left: 50%;
G7 z4 J6 t! p, P2 ]margin-left: -150px; ( o0 e2 i* b5 r" u
margin-top: -106px; ! A4 J# b; r8 H2 O
}
% N; [9 D& Z! N.share-buttons .share-button 5 ?* x4 O) p7 y0 ~0 k) V/ x
{
" O' v) o+ C) S/ ?4 u6 o4 Yfloat: left; , Z7 r1 q! k$ x. t
margin-top: 15px; 8 r6 F9 v' ~! U' `% M
}
4 p* l# ^( P: Q7 ]8 H.share-buttons .share-button:first-child
4 P+ _& V+ p. u8 d( ?$ O! a{
8 p, \, {4 F4 x( a5 V6 P" Lmargin-top: 0; , p3 T5 e) X n6 w; M7 g
}
1 V5 B4 O1 N, Y8 ^.share-buttons .share-button:after * |) \4 z A- z( H% }4 r& L4 g+ v
{
u7 s' {: h$ Yclear: both;
: V! H2 x/ S7 _* Y3 J4 ^6 ?display: table;
1 h7 K- D: L. e8 b: `! \6 W} / ^5 J1 g4 U6 z) j% ~# m
" c; i O# z5 r6 ]. A.share-button / p1 c1 p# R0 b6 m5 e
{ / B3 L, |2 q0 c% W5 `0 }
display: block;
: o& X: o0 _: A5 x$ xposition: relative;
6 @7 D4 N$ C! l3 e3 b0 ~' rheight: 30px;
$ F3 m/ p. B6 |5 [}
' N2 Q6 n! y) h8 p.share-button:hover
+ {9 y& s5 K/ `5 s& m+ h1 v. }1 }{ 3 X8 d% g! x: Z1 j8 P5 L& G/ B
cursor: pointer;
" M" V/ \- r+ Z+ R4 n} ) }. W+ P) R$ H" P
.share-button:hover .share-button-primary
6 Y; Z2 s. Z: b- W* v' Y) V{
) L1 Z! K7 D/ }( L1 F+ T9 Gbox-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.1); 6 m- u, {* @4 D6 Y$ |0 H
} ( T$ o# `( u V) t5 W8 m5 F
.share-button:hover .share-button-secondary-content ' `7 w$ Z7 g! p! k
{ : g. W' @( M4 {8 x2 S
-webkit-transform: translate3d(0, 0, 0); . w( |6 S5 k0 J% T- t
transform: translate3d(0, 0, 0);
. a) `" c) `. P. `% X$ b. }) u} * m% W! P; W/ A# _( g* t
7 d- x% l4 b5 Q: M4 k# |+ _
.share-button-primary / Y# c0 e' z* H0 b& B
{
" H9 [" l' L( @$ Rposition: absolute; " r" w5 D* \6 ^* C! M4 l% y
background: #fff;
& P2 z2 ]3 [" r* R& e7 `2 fwidth: 30px;
2 a7 t8 t! [; _7 |9 aheight: 30px;
8 T# J y0 U3 m, h' u" V- ]$ Iborder-radius: 15px; ) ?/ K9 h- E& u1 h3 _
left: 0;
: C- f! ?# |8 O! l, ?top: 50%; ! Y2 w- ^/ b: r- Q- [
margin-top: -15px; 8 j1 }+ m$ Q* V9 k' ?) \9 x# J
}
+ U2 y D5 x7 O8 z
; g. {! M8 k5 o/ O.share-button-icon
; u% G! T/ D6 Q7 Q1 a{ ' {; g* v' S# n
display: block;
" b3 e# ?* L# s5 R8 w# Mcolor: #242424;
2 Y9 T9 `1 S) |8 B4 j3 aposition: absolute; 3 j Y) ~# B, F
width: 30px;
, k* M' P8 z; v& ~line-height: 30px;
/ C5 W% Z5 x/ `3 D$ L) bfont-size: 16px; ! Y6 B$ J; A5 F
margin-top: 1px; $ v( s1 ?- Q; W+ `: A7 s7 z& v
} 0 M+ D+ q2 k- m! ~3 ~! @: u# a
& i M/ h" X" @, l' P2 y% V d: _6 {.share-button-secondary * D) t* v7 ]1 h- P6 U( p6 Z
{ 1 G' s w- e3 A- a3 O/ g- |( C
overflow: hidden;
. n, R+ c' _; |0 f, rmargin-left: 15px;
5 D/ p; D# T2 c5 Nheight: 30px;
) F+ u- {& ^$ S! m}
2 b% p5 P7 A9 P5 p
' G! X2 I* i: Q# S E1 Z.share-button-secondary-content - m' d3 } o, j" k
{
/ g/ S, Z% `2 q7 I4 gfont-family: sans-serif; M/ Q+ _) Q1 s0 |0 Z: a( Q
font-size: .75em;
3 n. O4 }* \& z" t5 b, Zbackground: #fff; 9 Y# E1 Z$ I# }3 [ i! K4 ~
display: block; 3 J5 S6 A1 v$ }/ V i+ s2 h
height: 30px; ( _% Q' F, x$ p w; T8 \
text-align: left; , K: I1 ?4 k. k" S" K4 W6 M: @2 a
padding-left: 24px; ; o t9 V. h* Z7 t6 q
padding-right: 18px;
+ w$ c% m5 x7 Q0 b8 T! wline-height: 30px; ( A. g, l* l: B" V8 s( [$ e C
color: #242424;
T2 q1 F0 ~% ?' D- uborder-radius: 0 15px 15px 0;
- ]( E( x' i) j/ \6 `-webkit-transform: translate3d(-100%, 0, 0); , V( j L# l4 c7 Q J0 ~' I8 q6 ?
transform: translate3d(-100%, 0, 0);
. u& i4 T1 ~. C4 G* |2 R9 z4 w-webkit-transition: -webkit-transform 175ms ease;
9 x9 D1 I# M: m1 n( ntransition: transform 175ms ease;
. a, a p* ^; ~* z! K* ^2 J9 E}
) J. P; r4 C5 C. l; D J& d9 o+ \# G% G# k
更多网页制作信息请查看: 网页制作 |
|