Skip to content

Instantly share code, notes, and snippets.

@ganglio
Created April 2, 2012 17:37
Show Gist options
  • Save ganglio/2285526 to your computer and use it in GitHub Desktop.
Save ganglio/2285526 to your computer and use it in GitHub Desktop.
CSS + HTML - Possible dock implementation
<!DOCTYPE HTML>
<html lang="en-GB">
<head>
<meta charset="UTF-8">
<title>Dock</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<ul>
<li>
<div id="li1"><a href="#li1">1</a></div>
</li>
<li>
<div id="li2"><a href="#li2">2</a></div>
</li>
<li>
<div id="li3"><a href="#li3">3</a></div>
</li>
<li>
<div id="li4"><a href="#li4">4</a></div>
</li>
<li>
<div id="li5"><a href="#li5">5</a></div>
</li>
</ul>
</body>
</html>
ul {
list-style: none;
padding: 0;
margin: 100px auto;
display: block;
background-color: blue;
height:40px;
width:200px
}
li {
width:40px;
height:40px;
display:block;
float:left;
font-size:;
position:relative;
}
ul:hover div:not(:hover),
div {
background-color:white;
border: 1px solid black;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
font-size:20px;
line-height:40px;
text-align:center;
width: 40px;
height:40px;
position:absolute;
top:50%;
left:50%;
margin:-20px;
z-index: 1;
transition: all 0.25s ease-in;
-moz-transition: all 0.25s ease-in;
-webkit-transition: all 0.25s ease-in;
-o-transition: all 0.25s ease-in;
-ms-transition: all 0.25s ease-in;
}
div a {
display: block;
width: 100%;
height: 100%;
text-decoration: none;
font-weight: bold;
color: black;
}
div a:active {
background-color: rgba(0,0,0,0.1);
}
div:hover,
div:target {
width:60px;
height:60px;
margin:-30px;
z-index: 2;
line-height:60px;
background-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment