Skip to content

Instantly share code, notes, and snippets.

@sanryuu
Created March 22, 2015 07:09
Show Gist options
  • Save sanryuu/51196460040211d35f00 to your computer and use it in GitHub Desktop.
Save sanryuu/51196460040211d35f00 to your computer and use it in GitHub Desktop.
クリックすると画面が切り替わるCSSのサンプル
<html>
<head>
<link rel="stylesheet" href="sample.css">
</head>
<div class="background">
<div class="clicked">
</div>
</div>
</body>
</html>
.background{
background-color:blue;
position: absolute;
top: 00px;
left: 00px;
height: 300px;
width: 300px;
}
.clicked{
background-color:red;
position: absolute;
top: 0px;
left: 300px;
height: 300px;
width: 300px;
}
.clicked:hover{
top: 0;
left: 0;
}
.background:active .clicked{
top: 0;
left: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment