Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 클릭display:none #클릭하면버튼노출
- animation progressbar
- node-sass #sass #사스
- git remote: Permission to .. denied to error: 403 에러
- PHP설치
- JSON.stringify()
- 부트스트랩 프로그레스바
- 자바스크립트객체배열로
- 빗버킷ssh
- 버튼클릭하면박스나타남 #버튼클릭시박스노출 #버튼클릭시아래버튼밀어내림
- 바닐라자바스크립트 텍스트 바꾸기
- 이미지유무체크
- nginx설치
- node-sass #dart-sass
- 체크박스
- vanillajs
- #push() 함수 #Object.keys()함수 #Object.values()함수 #Object.entries()함수
- 자바스크립트객체를문자열로
- JSON.parse()
- 바닐라자바스크립트
- 애니메이션프로그레스바
- CSS버튼애니메이션 #버튼클릭하면
- nginx와php연동
- nginx루트경로변경
- CSS버튼효과
- PHP에서데이터로그
Archives
- Today
- Total
●▲■ 개발일기
[CSS] 버튼 클릭 시 애니메이션 효과. (컬러, 사이즈) 본문
보통 버튼을 클릭하면 컬러가 바뀌거나 버튼 사이즈가 변한다.
커서가 손가락 모양으로 바뀌는 건 cursor: pointer; 를 적용하면 되지만
버튼 배경색이 변한다거나, 버튼 사이즈가 커졌다 작아졌다 하는 건 CSS로 적용해줘야 한다.
.클래스명:active {변경하고 싶은 스타일;}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>버튼 클릭 시 효과</title>
</head>
<style>
body {
width: 100%;
height: 100vh;
background-color: #eee;
display: flex;
justify-content: center;
align-items: center;
}
.btn--test--01 {
transition: all .25s;
width: 30%;
height: 10rem;
padding: 3rem;
background: #ff9100;
color: #fff;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.btn--test--01:active {
background-color: rgba(255, 230, 0, 0.8);
}
.btn--test--02 {
transition: all .25s;
width: 30%;
height: 10rem;
padding: 3rem;
background: #ff9100;
color: #fff;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.btn--test--02:active {
background-color: rgba(145, 255, 0, 0.8);
}
</style>
<body>
<div class="btn--test--01">
버튼 클릭 테스트 01
</div>
<div class="btn--test--02">
버튼 클릭 테스트 02
</div>
</body>
</html>
'👉 css.scss.sass > css' 카테고리의 다른 글
[CSS] flex: 1에 관한 예제 (0) | 2025.04.08 |
---|---|
[CSS]버튼 클릭하면 박스가 나타나면서 아래 박스 부드럽게 밀어내리는 애니메이션 CSS (0) | 2022.04.29 |
[CSS] display: none 애니메이션 적용하기 (fade in, out) (0) | 2021.12.28 |