본문 바로가기

Python_WEB/HTML

HTML5 - 190622 Basic Study 46(Transition Graph)

반응형

1. HTML Code

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>움직이는 그래프 만들기</title>
<link href="css/ex02.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>움직이는 그래프 만들기</h1>
<!-- div#graph>div.bar{data$}*5 -->
<div id="graph">
  <div class="bar">data1</div>
  <div class="bar">data2</div>
  <div class="bar">data3</div>
  <div class="bar">data4</div>
  <div class="bar">data5</div>
</div>
</body>
</html>

 

2. CSS Code

@charset "utf-8";
/* CSS Document */

*{
	margin:0;
	padding:0;
}

#graph{
	width:610px;
	border:3px solid black;
}
.bar{
	width:10px;
	height:50px;
	background-color:red;
	margin:5px;
	transition-duration:5s;
}

#graph:hover>div.bar{
	width:600px;
	transition-timing-function:linear;
	background-color:orange;
}

div.bar:nth-child(1){
	transition-delay:0s;
	background-color:peru;
	transition-timing-function:ease-in;
}
div.bar:nth-child(2){
	transition-delay:0.5s;
	background-color:pink;
	transition-timing-function:ease-in-out;
}
div.bar:nth-child(3){
	transition-delay:1s;
	background-color:gold;
	transition-timing-function:ease;
}
div.bar:nth-child(4){
	transition-delay:1.5s;
	background-color:red;
	transition-timing-function:ease-in;
}
div.bar:nth-child(5){
	transition-delay:2s;
	background-color:gray;
	transition-timing-function:ease-out;
}

#graph:hover>div.bar:nth-child(1){
	background-color:peru;
}
#graph:hover>div.bar:nth-child(2){
	background-color:pink;
}
#graph:hover>div.bar:nth-child(3){
	background-color:gold;
}
#graph:hover>div.bar:nth-child(4){
	background-color:red;
}
#graph:hover>div.bar:nth-child(5){
	background-color:gray;
}

 

3. HTML / CSS 파일

ex02.html
0.00MB
ex02.css
0.00MB

반응형