HTML
<div class="button-box">
<button class="btn">HELLO</button>
<button class="btn2">slide</button>
<button class="btn3">hover</button>
</div>
CSS
/* 버튼 */
.button-box {
/* height: 100vh; */
/* display: flex;
justify-content: center;
align-items: center; */
}
.button-box .btn {
font-size: 25px;
padding: 15px 30px;
color: #000;
border: 3px solid #000;
border-radius: 30px;
text-transform: uppercase;
letter-spacing: 4px;
transition: all 0.4s;
}
.button-box .btn:focus {
outline: none;
}
.button-box .btn:hover {
background-color: #000;
color: #fff;
}
/* slide button btn2 */
.button-box .btn2 {
font-size: 25px;
padding: 15px 30px;
border: 3px solid gold;
background-color: #a1a1a1;
color: gold;
text-transform: uppercase;
letter-spacing: 5px;
font-weight: bold;
position: relative;
transition: all 0.4s;
overflow: hidden;
z-index: 1;
}
.button-box .btn2:focus {
outline: none;
}
.button-box .btn2::before {
content: "";
position: absolute;
height: 100%;
width: 100%;
background-color: gold;
top: 100%;
left: 0;
transition: all 0.4s;
z-index: -1;
}
.button-box .btn2:hover::before {
transform: translateY(-100%);
}
.button-box .btn2:hover {
color: #0f0f0f;
}
hover line
/* hover line */
.button-box .btn3 {
font-size: 25px;
padding: 15px;
border: 0;
background-color: transparent;
letter-spacing: 0;
-webkit-transition: all 0.28s ease-in-out;
transition: all 0.28s ease-in-out;
}
.button-box .btn3:focus {
outline: none;
}
.button-box .btn3:hover,
.button-box .btn3:focus,
.button-box .btn3:active {
letter-spacing: 5px;
}
.button-box .btn3:after,
.button-box .btn3:before {
border: 1px solid rgba(255, 255, 255, 0);
bottom: 0;
content: " ";
display: block;
margin: 0 auto;
position: relative;
-webkit-transition: all 0.28s ease-in-out;
transition: all 0.28s ease-in-out;
width: 0;
}
.button-box .btn3:hover:after,
.button-box .btn3:hover:before {
border-color: #e00303;
-webkit-transition: width 350ms ease-in-out;
transition: width 350ms ease-in-out;
width: 70%;
}
.button-box .btn3:hover:before {
bottom: auto;
top: 0;
}
'작업 일지 > HTML CSS' 카테고리의 다른 글
position: sticky > 요소 고정 사용 (0) | 2024.03.08 |
---|---|
input style / input[type=checkbox/radio] 디자인 적용 (0) | 2024.03.07 |
input style / input[type=checkbox]와 input[type=radio] 스타일 적용 (0) | 2024.03.05 |
IE 조건문 CSS (특정버전 이하의 브라우저일경우 적용) (0) | 2023.07.05 |
[CSS]반응형 웹 이디어쿼리 mediaquery (0) | 2023.07.05 |