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
- 빗버킷ssh
- animation progressbar
- PHP설치
- CSS버튼애니메이션 #버튼클릭하면
- 바닐라자바스크립트 텍스트 바꾸기
- 자바스크립트객체배열로
- node-sass #dart-sass
- #push() 함수 #Object.keys()함수 #Object.values()함수 #Object.entries()함수
- 버튼클릭하면박스나타남 #버튼클릭시박스노출 #버튼클릭시아래버튼밀어내림
- 부트스트랩 프로그레스바
- 자바스크립트객체를문자열로
- 클릭display:none #클릭하면버튼노출
- nginx루트경로변경
- 애니메이션프로그레스바
- nginx설치
- nginx와php연동
- git remote: Permission to .. denied to error: 403 에러
- JSON.stringify()
- 바닐라자바스크립트
- vanillajs
- PHP에서데이터로그
- node-sass #sass #사스
- CSS버튼효과
- 체크박스
- JSON.parse()
- 이미지유무체크
Archives
- Today
- Total
●▲■ 개발일기
[CSS]버튼 클릭하면 박스가 나타나면서 아래 박스 부드럽게 밀어내리는 애니메이션 CSS 본문
<!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>Document</title>
<style>
body {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
nav {
padding: 3rem;
background-color: #e1e1e1;
width: 100%;
text-align: center;
}
.box1 {
display: flex;
align-items: center;
justify-content: center;
width: 20rem;
height: 5rem;
background-color: #ff0000;
color: #fff;
margin: 1rem;
}
.box2 {
display: flex;
align-items: center;
justify-content: center;
width: 20rem;
background-color: #ffaa00;
color: #fff;
margin: 1rem;
visibility: hidden;
height: 0vh;
opacity: 0;
transition: all .5s;
flex-direction: column;
}
.box2 .text-box {
display: block;
position: relative;
text-align: center;
padding: 1rem;
font-size: 1rem;
}
.on {
visibility: visible;
height: fit-content;
opacity: 1;
padding: 2rem 0;
}
.box3 {
display: flex;
align-items: center;
justify-content: center;
width: 20rem;
height: 5rem;
background-color: #709900;
color: #fff;
margin: 1rem;
}
button {
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
width: 80%;
margin: 2rem;
background-color: #006bae;
border-radius: .5rem;
color: #fff;
}
</style>
</head>
<body>
<!-- <div class="box3">
box3
</div> -->
<nav>
버튼 클릭하면 박스가 나타나면서 아래 박스 부드럽게 밀어내리는 애니메이션 CSS
</nav>
<div class="box2">
box2
<div class="text-box">
Lorem ipsum
</div>
</div>
<div class="box1">
box1
</div>
<button onclick="document.querySelector('.box2').classList.toggle('on')">box2 Show!</button>
</body>
</html>
'👉 css.scss.sass > css' 카테고리의 다른 글
[CSS] flex: 1에 관한 예제 (0) | 2025.04.08 |
---|---|
[CSS] 버튼 클릭 시 애니메이션 효과. (컬러, 사이즈) (0) | 2022.02.12 |
[CSS] display: none 애니메이션 적용하기 (fade in, out) (0) | 2021.12.28 |