본문 바로가기

웹 프로그래밍/CSS

[CSS] 이미지 회전하기 (img 태그, transform : rotate, transform : translate, transform:skew)

 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<style>
	img {
		position : absolute;
		left : 100px;
		top : 100px;
		border : 10px groove red; 
		/* transform : rotate(30deg); */ 
		-webkit-transform : rotate(30deg); /* 사파리, 크롬 */
		-moz-transform : rotate(30deg); /* 파이어폭스 */
		-o-transform : rotate(30deg); /* 오페라 */
		-ms-transform : rotate(120deg); /* 마이크로소프트 */
		
	}
</style>

</head>
<body>
	<img src = "../html/images/추노2.jpg">
</body>
</html>

 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
	#img01 {
		position: absolute;
		left: 50px;
		top: 50px;
	}
	
	#img02 {
		position: absolute;
		left: 100px;
		top: 100px;
		transform: translate(100px, 100px); 
	}
	
	#img03 {
		position: absolute;
		left: 500px;
		top: 500px;
		transform: skew(30deg); 
	}
	
</style>

</head>
<body>
	<img src = "../html/images/추노2.jpg" id ="img01">
	<img src = "../html/images/추노2.jpg" id ="img02">
	<img src = "../html/images/추노2.jpg" id ="img03">
	

</body>
</html>