Created
May 29, 2013 07:11
-
-
Save dreamsky/5668486 to your computer and use it in GitHub Desktop.
前端试题:CSS 九宫格效果
This file contains hidden or 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"> | |
<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