λ³ν μμ±
μμμ ν¬κΈ°, λͺ¨μ, μμΉλ₯Ό λ³νμν€λ μμ±
λ³ν μμ±μ μ’ λ₯
μμ± | μ€λͺ
| μμ μ½λ |
transform | μμμ λ€μν λ³ν ν¨κ³Όλ₯Ό μ μ©ν©λλ€. | transform: rotate(45deg); |
transform-origin | λ³νμ κΈ°μ€μ μ μ€μ ν©λλ€. | transform-origin: top left; |
κΈ°λ³Έ μμ μ½λ
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>λ³ν μμ± μμ</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
}
/* transform μμ */
.transform-example {
width: 150px;
height: 150px;
background-color: lightcoral;
margin: 20px auto;
display: inline-block;
}
.rotate {
transform: rotate(45deg);
}
.scale {
transform: scale(1.5);
}
.translate {
transform: translate(50px, 50px);
}
.skew {
transform: skew(20deg, 10deg);
}
/* transform-origin μμ */
.transform-origin-example {
width: 150px;
height: 150px;
background-color: lightblue;
margin: 20px auto;
display: inline-block;
transform: rotate(45deg);
transform-origin: top left;
}
</style>
</head>
<body>
<!-- transform μμ -->
<div class="transform-example rotate">νμ </div>
<div class="transform-example scale">νλ</div>
<div class="transform-example translate">μ΄λ</div>
<div class="transform-example skew">κΈ°μΈμ</div>
<!-- transform-origin μμ -->
<div class="transform-origin-example">κΈ°μ€μ λ³κ²½</div>
</body>
</html>
HTML
볡μ¬