Skip to content

Instantly share code, notes, and snippets.

@dreamsky
Created May 29, 2013 07:11
Show Gist options
  • Save dreamsky/5668486 to your computer and use it in GitHub Desktop.
Save dreamsky/5668486 to your computer and use it in GitHub Desktop.
前端试题:CSS 九宫格效果
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nine Grid</title>
<style>
ul {
width: 165px;
padding: 30px;
}
ul li{
float: left;
list-style: none;
position: relative;
}
li a {
display: block;
width: 50px;
height: 50px;
border: 5px solid blue;
margin-left: -5px;
margin-top: -5px;
}
a:hover {
position: relative;
border-color: red;
z-index: 100;
}
.fn-clear:after{
visibility: hidden;
display: block;
content: ' ';
clear: both;
}
.fn-clear{
*zoom: 1;
}
</style>
</head>
<body>
<ul class="fn-clear">
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
<li><a href="" class="1"></a></li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment