μ€λμ mediaquery, button, perspectiveμ λν΄μ λ°°μ λ€.
μ‘Έμ
κ³Όμ νλ©΄μ λ―Έλμ΄μΏΌλ¦¬κ° κ°μ₯ μ΄λ €μ κΈ°λλ¬Έμ,
λ―Έλμ΄μΏΌλ¦¬ λΆλΆμ κ°μ₯ κ΄μ¬μ΄ λ§μλλ°
κ°λ¨νκ² κ°λ₯΄μ³μ£Όμ
μ μ’ μμ¬μ λ€π₯
μ§λ λͺ» λ°λΌκ° λΆλΆμ νΌμμ 곡λΆνκ³ μλλ°,
λ΄κ° 곡λΆνλ μλλ³΄λ€ λ§€μΌ μ§λ λκ°λ μλκ° λ λΉ λ₯΄λ€π
μ μ΄κ±΄ μ€λ λ§λ λ²νΌμ΄λ€.
짧μ μκ°λμ λ§λ κ±° μΉκ³ λ μμκ² λ§λ€μ΄μ§κ±°κ°λ€.
μ£Όλ§μ μκ°μ΄ μκΈ°λ©΄ λ μμκ² λ§λ€μ΄λ΄μΌμ§ 룰루β¨
β¨ μ½λλ μ¬κΈ°!
<!DOCTYPE html>
<html lang="ko">
<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>button</title>
<style>
.btn {
border: 4px solid palevioletred;
border-radius: 50%;
padding: 20px 52px;
background: none;
color: palevioletred;
font-size: 20px;
position: relative;
overflow: hidden;
cursor: pointer;
transition: all .5s;
margin-left: 80px;
width: 200px;
height: 200px;
}
@keyframes wave {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.inside {
position: absolute;
width: 300px;
height: 300px;
background: turquoise;
opacity: 0.4;
border-radius: 45%;
top: 0;
left: -100px;
margin-top: 200px;
transform: translateY(0);
transition-duration: 5s;
transition-timing-function: ease;
}
.btn:hover .inside {
margin-top: 80px;
animation: wave 8s;
}
.inside2 {
position: absolute;
width: 300px;
height: 300px;
background: violet;
opacity: 0.4;
border-radius: 45%;
top: 0;
left: 0px;
margin-top: 200px;
transform: translateY(0);
transition-duration: 5s;
transition-property: margin-top;
transition-timing-function: ease;
}
.btn:hover .inside2 {
margin-top: 80px;
animation: wave 10s;
}
</style>
</head>
<body>
<div class="wrap">
<button class="btn">Click Me!
<div class="inside"></div>
<div class="inside2"></div>
</button>
</div>
</body>
</html>
μμ
μ ν΅ν΄ reset CSSλΌλ κ²μ μκ²λμλ€.
κΈ°λ³Έ μ€νμΌμ μ΄κΈ°νμμΌμ λμμΈμ μ½κ²ν μμλλ‘νλ
μν μ νλ€κ³ νλ€.
β¨reset css λ§ν¬ https://meyerweb.com/eric/tools/css/reset/
section p {
text-shadow: none;
}
μμ μ νμ (>)
: μ μμμ μμ(λ°λ‘ μλ νμμμ)μ μ νν¨
section > p {
text-shadow: none;
}
h1 + p {
color: red;
}
h1 ~ p {
color: red;
}