[css] css 메뉴 이미지 롤오버 효과 2
페이지 정보
본문
<style type="text/css">
ul#top-menu {
width: 458px;
list-style: none;
}
ul#top-menu li { display: inline; }
ul#top-menu li a {
display: block; float: left; height: 6px;
background-image: url(img/topmenu.gif); text-indent: -9999px;
}
ul#top-menu li a.m1 {
width: 30px; background-position: 0 0; margin-right:15px;
}
ul#top-menu li a.m2 {
width: 41px; background-position: -45px 0; margin-right:13px;
}
ul#top-menu li a.m3 {
width: 45px; background-position: -99px 0; margin-right:12px;
}
ul#top-menu li a.m4 {
width: 53px; background-position: -156px 0; margin-right:15px;
}
ul#top-menu li a.m5 {
width: 89px; background-position: -224px 0; margin-right:14px;
}
ul#top-menu li a.m6 {
width: 21px; background-position: -327px 0; margin-right:17px;
}
ul#top-menu li a.m7 {
width: 41px; background-position: -365px 0; margin-right:15px;
}
ul#top-menu li a.m8 {
width: 37px; background-position: -421px 0;
}
ul#top-menu li a.m1:hover, ul#top-menu li a.m1:focus {
background-position: 0 -6px;
}
ul#top-menu li a.m2:hover, ul#top-menu li a.m2:focus {
background-position: -45px -6px;
}
ul#top-menu li a.m3:hover, ul#top-menu li a.m3:focus {
background-position: -99px -6px;
}
ul#top-menu li a.m4:hover, ul#top-menu li a.m4:focus {
background-position: -156px -6px;
}
ul#top-menu li a.m5:hover, ul#top-menu li a.m5:focus {
background-position: -224px -6px;
}
ul#top-menu li a.m6:hover, ul#top-menu li a.m6:focus {
background-position: -327px -6px;
}
ul#top-menu li a.m7:hover, ul#top-menu li a.m7:focus {
background-position: -365px -6px;
}
ul#top-menu li a.m8:hover, ul#top-menu li a.m8:focus {
background-position: -421px -6px;
}
a { outline: none; }
</style>
<ul id="top-menu">
<li><a href="#m1" class="m1">Ninja</a></li>
<li><a href="#m2" class="m2">Zombie</a></li>
<li><a href="#m3" class="m3">Robot</a></li>
<li><a href="#m4" class="m4">Assassin</a></li>
<li><a href="#m5" class="m5">Jedi</a></li>
<li><a href="#m6" class="m6">Jedi</a></li>
<li><a href="#m7" class="m7">Jedi</a></li>
<li><a href="#m8" class="m8">Jedi</a></li>
</ul>
ul#top-menu {
width: 458px;
list-style: none;
}
ul#top-menu li { display: inline; }
ul#top-menu li a {
display: block; float: left; height: 6px;
background-image: url(img/topmenu.gif); text-indent: -9999px;
}
ul#top-menu li a.m1 {
width: 30px; background-position: 0 0; margin-right:15px;
}
ul#top-menu li a.m2 {
width: 41px; background-position: -45px 0; margin-right:13px;
}
ul#top-menu li a.m3 {
width: 45px; background-position: -99px 0; margin-right:12px;
}
ul#top-menu li a.m4 {
width: 53px; background-position: -156px 0; margin-right:15px;
}
ul#top-menu li a.m5 {
width: 89px; background-position: -224px 0; margin-right:14px;
}
ul#top-menu li a.m6 {
width: 21px; background-position: -327px 0; margin-right:17px;
}
ul#top-menu li a.m7 {
width: 41px; background-position: -365px 0; margin-right:15px;
}
ul#top-menu li a.m8 {
width: 37px; background-position: -421px 0;
}
ul#top-menu li a.m1:hover, ul#top-menu li a.m1:focus {
background-position: 0 -6px;
}
ul#top-menu li a.m2:hover, ul#top-menu li a.m2:focus {
background-position: -45px -6px;
}
ul#top-menu li a.m3:hover, ul#top-menu li a.m3:focus {
background-position: -99px -6px;
}
ul#top-menu li a.m4:hover, ul#top-menu li a.m4:focus {
background-position: -156px -6px;
}
ul#top-menu li a.m5:hover, ul#top-menu li a.m5:focus {
background-position: -224px -6px;
}
ul#top-menu li a.m6:hover, ul#top-menu li a.m6:focus {
background-position: -327px -6px;
}
ul#top-menu li a.m7:hover, ul#top-menu li a.m7:focus {
background-position: -365px -6px;
}
ul#top-menu li a.m8:hover, ul#top-menu li a.m8:focus {
background-position: -421px -6px;
}
a { outline: none; }
</style>
<ul id="top-menu">
<li><a href="#m1" class="m1">Ninja</a></li>
<li><a href="#m2" class="m2">Zombie</a></li>
<li><a href="#m3" class="m3">Robot</a></li>
<li><a href="#m4" class="m4">Assassin</a></li>
<li><a href="#m5" class="m5">Jedi</a></li>
<li><a href="#m6" class="m6">Jedi</a></li>
<li><a href="#m7" class="m7">Jedi</a></li>
<li><a href="#m8" class="m8">Jedi</a></li>
</ul>
추천0