Exquisite CSS code creation buttons

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.