티스토리 뷰

Language/CSS

[ CSS ] A Tag Button - 버튼

MiniNeko 2016. 1. 2. 22:09

1. Getting started 
<html>
    <head>
        <title>CSS Only Button Demo</title>
    </head>
</html>
 
2.Basic Styles
<style>
a.button {
    font-size:30px;
    color:#000;
    text-decoration:none;
    display:block;
    width:578px;
    padding:10px;
    border:1px solid #DDD;
    text-align:center;
 
    -moz-border-radius:5px;
    -webkit-border-radius:5px;
    -o-border-radius:5px;
    border-radius:5px;
}
a.button:hover {
    color:#FFF;
    border-color:#3278BE;
}
</style> 
 
3. CSS3 Background Gradients
background:#FFFFFF;
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#EEEEEE));
background:-moz-linear-gradient(0% 90% 90deg, #EEEEEE, #FFFFFF);
 
4. Custom Fonts
<link href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet" type="text/css" />
<style>
a {
    font-family: "Yanone Kaffeesatz", arial, serif;
}
</style>
 
5. Animation
a.button {
    ... other styles ...
 
    -webkit-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
    -o-transition: all .4s ease-in-out;
    transition: all .4s ease-in-out;
}
 
6. Bonus: Active State
a.button:active {
    background:#4195DD;
    background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#003C82), to(#4195DD));
    background:-moz-linear-gradient(0% 90% 90deg, #4195DD, #003C82);
}

Total
Today
Yesterday
최근에 올라온 글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31