씨네
공부하는 개발자 강씨네
씨네
  • 분류 전체보기 (460)
    • Web (21)
      • HTML (11)
      • CSS (10)
    • JS 관련 (49)
      • JavaScript (27)
      • JQuery (22)
    • TS 관련 (15)
      • TypeScript (15)
    • NodeJS (7)
      • NodeJS (7)
    • 따라하며 배우는 시리즈 (23)
      • NodeJS & ReactJS Basic (23)
      • NodeJS & ReactJS Movie (0)
      • NodeJS & ReactJS Youtube (0)
      • NodeJS & ReactJS ChatBot (0)
    • SPA (14)
      • React (14)
      • Vue (0)
      • Anguler (0)
    • Java 관련 (118)
      • Java (52)
      • JDBC (6)
      • JSP & Servlet (18)
      • Spring Legecy (38)
      • SpringBoot (4)
    • Python (26)
      • Python (20)
      • PyMongo (1)
      • Django (5)
    • Git (24)
      • Github (24)
    • RDB (22)
      • Oracle (21)
      • MySQL (1)
    • NoSQL (5)
      • MongoDB (5)
    • OS (4)
      • Linux (4)
    • 빅데이터 (2)
      • hadoop (2)
    • IDE (20)
      • eclipse (11)
      • VSCODE (4)
      • VisualStudio (1)
      • IntelliJ (1)
      • PyCharm (1)
      • DBeaver (2)
    • Install (3)
      • Tomcat (1)
      • Docker (1)
      • Anaconda (1)
    • 오류&에러 (28)
      • TS (2)
      • NodeJS (7)
      • SQL (8)
      • Java (1)
      • Spring (4)
      • Git (6)
      • 기타 (0)
    • 알고리즘 (67)
      • 수열 (1)
      • 백준(backjoon) (39)
      • Programmers (27)
    • 자격증 (5)
      • SQLD (5)
    • 기타 (2)
    • IT유튜브로 지식쌓기 (2)

공지사항

인기 글

최근 글

티스토리

250x250
hELLO · Designed By 정상우.
씨네

공부하는 개발자 강씨네

[CSS] transform
Web/CSS

[CSS] transform

2021. 12. 15. 14:32
728x90

1. translate

- 위치이동

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

<style type="text/css">
	#tlate{
		width: 200px;
		height: 200px;
		background: red;
		color: white;
		font-size: 30pt;
		word-wrap: break-word;
		transform: translate(50px, 50px);
	}
</style>

</head>
<body>

	<h1>Transform - translate</h1>
	<div id="tlate">translate(x, y) : 위치이동</div>
	
</body>
</html>

​

​

​

2. transrotate

- 회전

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

<style type="text/css">
	#trotate{
		width: 200px;
		height: 200px;
		background-color: red;
		color: white;
		font-size: 30pt;
		word-wrap: break-word;
		transform: rotate(30deg);
	}
</style>

</head>
<body>

	<h1>Transform - rotate</h1>
	<div id="trotate">rotate(deg) : 회전</div>
	
</body>
</html>

​

​

​

3. scale

- 확대/축소

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

<style type="text/css">
	#tscale{
		width: 200px;
		height: 200px;
		background-color: red;
		color: white;
		font-size: 30pt;
		word-wrap: break-word;
		transform: scale(0.6, 0.6);
	}
</style>

</head>
<body>

	<h1>Transform - scale</h1>
	<div id="tscale">scale(x, y) : 크기</div>
	
</body>
</html>

​

​

​

4. skew

- 찌그러뜨리기

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

<style type="text/css">
	#tskew{
		width: 200px;
		height: 200px;
		background-color: red;
		color: white;
		font-size: 30pt;
		word-wrap: break-word;
		transform: skew(20deg, 20deg);
	}
</style>

</head>
<body>

	<h1>Transform - skew</h1>
	<div id="tskew">skew(deg, deg) : 변형</div>
	
</body>
</html>

​

​

​

5. transition

- 속성 변환

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

<style type="text/css">
	#tran{
		width: 200px;
		height: 200px;
		background-color: red;
		color: white;
		font-size: 30pt;
		word-wrap: break-word;
		transition: width 0.5s, background 1.5s linear, transform 1.5s;
	}
	#tran:hover{
		width: 800px;
		background: blue;
		transform: translate(300px, 0px);
	}
</style>

</head>
<body>

	<h1>Transition</h1>
	<div id="tran">transition : 속성 전환</div>

</body>
</html>
 

마우스 올리기 전(위)과 마우스 올린 후(아래)

 

​

​

​

5-2.

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

<style type="text/css">
	li{
		width: 500px;
		background: gray;
		margin-bottom: 3px;
		font-size: 30pt;
		font-weight: bold;
		list-style-type: none;
		transition: width 1s linear, color 0.5s linear, letter-spacing 1s;
		cursor: pointer;
	}
	li:hover{
		width: 800px;
		color: red;
		letter-spacing: 10px;
	}
</style>

</head>
<body>
	
	<div>
		<h1>Moving Menu</h1>
		<ul>
			<li>COMPANY</li>
			<li>PRODUCT</li>
			<li>SERVICE</li>
			<li>COMMUNITY</li>
		</ul>
	</div>
	
</body>
</html>
728x90

'Web > CSS' 카테고리의 다른 글

[CSS] animation(애니메이션), 다단  (0) 2021.12.16
[CSS] border, background, text  (0) 2021.12.14
[CSS] 레이아웃(layout) - float, clear, display, overflow, position  (0) 2021.12.13
[CSS] 상자(box)  (0) 2021.12.12
[CSS] 배경(background)  (0) 2021.12.11
    'Web/CSS' 카테고리의 다른 글
    • [CSS] animation(애니메이션), 다단
    • [CSS] border, background, text
    • [CSS] 레이아웃(layout) - float, clear, display, overflow, position
    • [CSS] 상자(box)
    씨네
    씨네
    개발자 씨네가 공부하는 내용을 기록 겸 공유하는 블로그입니다!

    티스토리툴바