티스토리 뷰
Button A
.a-button {
background-color: rgb(20, 40, 192);
color: white;
border: none;
border-radius: 30px;
cursor: pointer;
margin-right: 10px;
margin-left: 30px;
padding-top: 20px;
padding-left: 16px;
padding-right: 16px;
padding-bottom: 16px;
transition: all 3s ease-in; /*모든 transition은 3초동안 일어나며 ease-in 방식이다.*/
}
.a-button:hover {
/*mouseover*/
opacity: 0.7;
background-color: black;
}
.a-button:active {
/*click*/
opacity: 0.1;
}
Button B
.b-button {
background-color: white;
border-color: rgb(212, 6, 64);
border-style: solid;
border-width: 1px;
color: rgb(6, 95, 212);
cursor: pointer;
padding-top: 9px;
padding-bottom: 9px;
padding-left: 16px;
padding-right: 16px;
transition: background-color 3s, color 0s; /*배경은 3초동안 변하며, 색은 0초동안(즉시) 변함*/
}
.b-button:hover {
/*mouseover*/
background-color: rgb(6, 95, 212);
color: white;
}
.b-button:active {
/*click*/
opacity: 0.7;
}
Button C
.c-button {
background-color: rgb(25, 69, 98);
color: white;
border: none;
height: 36px;
width: 80px;
border-radius: 8px;
font-weight: bold;
font-size: 15px;
cursor: pointer;
margin-left: 8px;
transition: all 1s ease-out; /*모두 1초동안 transition하면 ease-out 방식*/
}
.c-button:hover {
/*mouseover*/
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.541);
}
transition과 pseudo CSS 적용을 주로 기억해두면 될듯
'■ FE 로드맵 > ◻ CSS' 카테고리의 다른 글
| Margin & Padding & Border (0) | 2023.03.12 |
|---|---|
| Float & Clear (0) | 2023.03.12 |
| Pseudo (0) | 2023.03.12 |
| 기초 (0) | 2023.03.12 |