Skip to content

Instantly share code, notes, and snippets.

@ichiroku11
Created August 1, 2017 07:40
Show Gist options
  • Select an option

  • Save ichiroku11/4ada350c4a8da8ec5d176cd71112504c to your computer and use it in GitHub Desktop.

Select an option

Save ichiroku11/4ada350c4a8da8ec5d176cd71112504c to your computer and use it in GitHub Desktop.
CSS transitionを試す
.container .box {
background-color: #e4efff;
width: 100px;
margin-bottom: 10px;
padding: 1em 0.1em;
text-align: center;
}
.container:hover .box {
background-color: #ffefe4;
width: 300px;
}
.tran-ease {
transition: all 1s ease 0s;
}
.tran-linear {
transition: all 1s linear 0s;
}
.tran-easein {
transition: all 1s ease-in 0s;
}
.tran-easeout {
transition: all 1s ease-out 0s;
}
.tran-easeinout {
transition: all 1s ease-in-out 0s;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title></title>
</head>
<body>
<div class="container">
<div class="box tran-ease">
ease
</div>
<div class="box tran-linear">
linear
</div>
<div class="box tran-easein">
ease-in
</div>
<div class="box tran-easeout">
ease-out
</div>
<div class="box tran-easeinout">
ease-in-out
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment