Created
March 30, 2012 10:22
-
-
Save ganglio/2250629 to your computer and use it in GitHub Desktop.
CSS - Alternative inline blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
margin-top: 100px; | |
text-align: center; | |
font-size: 0; | |
} | |
.box { | |
background-color: green; | |
border-radius: 10px 10px 10px 10px; | |
font-size: 30px; | |
height: 40px; | |
line-height: 40px; | |
padding: 20px; | |
width: 100px; | |
margin: 10px 5px; | |
display: inline-block; | |
vertical-align: bottom; | |
-moz-transition: all 0.25s ease; | |
} | |
.box:hover { | |
height: 60px; | |
width: 150px; | |
margin: 0 5px; | |
line-height: 60px; | |
font-size: 40px; | |
} | |
.box:hover + .box { | |
background-color: red; | |
height: 50px; | |
width: 140px; | |
margin: 5px; | |
line-height: 50px; | |
font-size: 35px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-GB"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Expandable Boxes</title> | |
<link rel="stylesheet" href="boxes.css" /> | |
</head> | |
<body> | |
<div class="container"> | |
<span class="box">pippo</span> | |
<span class="box">pippo</span> | |
<span class="box">pippo</span> | |
<span class="box">pippo</span> | |
<span class="box">pippo</span> | |
<span class="box">pippo</span> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment