当前位置:   article > 正文

html图片定位案例,css 背景图片定位在菜单效果中的应用实例

html层定位图片案例

Example Source Code [www.52css.com]

#menu {

list-style: none;

padding: 0;

margin: 0;

width: 774px;

height: 210px;

background: url(images/menu-bg.jpg) no-repeat;

position: relative;

}

#menu span {

display: none;

position: absolute;

}

#menu a {

display: block;

text-indent: -900%;

position: absolute;

outline: none;

}

#menu a:hover {

background-position: left bottom;

}

#menu a:hover span {

display: block;

}

#menu .home {

width: 144px;

height: 58px;

background: url(images/home.gif) no-repeat;

left: 96px;

top: 73px;

}

#menu .home span {

width: 86px;

height: 14px;

background: url(images/home-over.gif) no-repeat;

left: 28px;

top: -20px;

}

#menu .about {

width: 131px;

height: 51px;

background: url(images/about.gif) no-repeat;

left: 338px;

top: 97px;

}

#menu .about span {

width: 40px;

height: 12px;

background: url(images/about-over.gif) no-repeat;

left: 44px;

top: 54px;

}

#menu .rss {

width: 112px;

height: 47px;

background: url(images/rss.gif) no-repeat;

left: 588px;

top: 94px;

}

#menu .rss span {

width: 92px;

height: 20px;

background: url(images/rss-over.gif) no-repeat;

left: 26px;

top: -20px;

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/110505?site
推荐阅读
相关标签
  

闽ICP备14008679号