본문 바로가기
호구지책/웹

[CSS] 스타일 버튼

by 하늘의흐름 2015. 6. 11.
반응형

<style type="text/css">

<!--

/* 버튼 스타일 추가. 일반적인 버튼의 상황 */


button::-moz-focus-inner,

input::-moz-focus-inner {

    border: 0;

    padding: 0;

}

 

.ct-btn {

    display: inline-block;

    margin: 5px 0;

    padding: .5em .75em;

    border-radius: .25em;

    box-sizing: content-box;

    -moz-box-sizing: content-box;

    background: transparent;

    outline: 0;

    vertical-align: middle;

    font-family: inherit;

    font-size: 18px;

    text-decoration: none;

    white-space: nowrap;

    cursor: pointer

}


.ct-btn.white,

.ct-btn.white:link,

.ct-btn.white:visited {

    color: #fff;

    border: 1px solid #ebebeb;

    border-bottom-color: #c6c6c6;

    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.04); 

    background: linear-gradient(to bottom, #349DCF 40%, #0184C3 100%);

 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#349DCF', endColorstr='#0184C3', GradientType=0 );/*IE*/

 /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f6f6f6', GradientType=0 );*//*IE*/

}

 

/* 마우스오버 */

.ct-btn.white:focus,

.ct-btn.white:hover {

    background: #f4f4f4;

    background: linear-gradient(to bottom, #0184C3 0%, #349DCF 100%);

 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0184C3', endColorstr='#349DCF', GradientType=0 );/*IE*/

 /*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#ffffff', GradientType=0 );*//*IE*/

}

 

/* 눌려졌거나 선택 된 상황 */

.ct-btn.white:active,

.ct-btn.white.active {

    text-shadow: 0 1px 0px #fff;

    border-color: #ebebeb;

    border-top-color: #ddd;

    background: #0184C3;

    box-shadow: none

}


//-->

</style>


적용된 모습은 다음과 같다.




적용하는 Html 코드

<input type="button" class="ct-btn white en-01" style="font-size: 32px; font-weight: bold;" onclick="openWindow();" value="Submit"/>

반응형

댓글