In this articleArticle, We will use css3CodeMake exquisite buttons.
Simple HTML code
Basic CSS code Rendering
Css3 code Rendering
Css3 background color
Make the button bigger
Effect of passing and clicking
Step 1: HTML code
Create a simple <A> tag code using HTML code, and add class: button, big, blue/green/gray for each Tag:
12345 |
< A Href = "#" Class = "Button big blue"
> Button </ A > < A Href = "#" Class = "Button big green" > Button </ A > < A Href =
"#" Class = "Button big gray" > Button </ A > |
Preview:
Part 2: basic CSS code
First, we use the basic css2 code to add basic CSS style rendering, basic shape and style through. Button.
CSS code:
123456789 |
. Button { Display
: Inline- Block ; Position : Relative ; Margin : 10px ; Padding : 0 20px
; Text-align : Center ; Text-Decoration : None ; Font : Bold 12px / 25px Arial , Sans-serif ; } |
Then we define different colors for each <A> label based on blue/green/Gray:
1234567891011121314151617181920 |
/* Green */ . Green { Color : #3e5706 ; Background
: # A5cd4e ; } /* Blue */ . Blue { Color : # 19667d ; Background :
#70c9e3 ; } /* Gray */ . Gray { Color : #515151 ; Background : # D3d3d3
; } |
By using the button and the basic code rendering of the color class, the button has taken shape.
Preview effect:
Step 3: css3 code rendering.
Through the first two basic codes, the basic prototype of the button has appeared. Now we use css3 code to perform advanced rendering of the button,
Add shadow and rounded corner effects.
123456789101112131415161718192021222324252627 |
. Button { Display : Inline- Block ; Position : Relative
; Margin : 10px ; Padding : 0 20px ; Text-align : Center ;
Text-Decoration : None ; Font : Bold 12px / 25px Arial , Sans-serif ; Text-shadow
: 1px 1px 1px Rgba ( 255 , 255 , 255 ,. 22 ); /* Text shadow effect */ -WebKit-border-radius: 30px
; /* Rounded corner effects for different browsers */ -Moz-border-radius: 30px ; Border-radius: 30px ; -WebKit-box-Shadow: 1px 1px 1px Rgba (
0 , 0 , 0 ,. 29 ), Inset 1px 1px 1px Rgba ( 255 , 255 , 255 ,. 44
); -Moz-box-Shadow: 1px 1px 1px Rgba ( 0 , 0 , 0 ,. 29 ), Inset 1px 1px 1 |