1. First
just create a normal button (here I am taking an HTML button) without any style.
- <input type="button" value="My Button"/>
The output will be

2. Now
define the basic style like font type, font color in CSS by creating a CSS
class named button
- <style type="text/css">
- .button {
- font-size: 11px;
- font-weight: bold;
- font-family: Arial;
- color: #ffffff;
- }
- </style>
3. Set
the CSS class for this button
- <input type="button" value="My Button" class="button"/>
The output will be
4. Define
more style like width, height, cursor, padding, outline, text-align etc.
- min-width: 54px;
- height: 24px;
- white-space: nowrap;
- cursor: pointer;
- outline: 0 none;
- padding: 0 10px 2px;
- text-align: center;
Explanation:
|
Property Name
|
Description
|
|
min-width
|
Set the minimum width of the button
|
|
white-space
|
Specify that the text of the button will never wrap
|
|
outline
|
Set the outline style of the button
|
|
padding
|
Set the top, left, right and bottom padding value
|
The output will be
5. Set
border style for rounded corners and color. The border-radius is used
Dhanik SahniPosted Jul 11, 2013, 1:49 AM
Nice one.