Home  >  Article  >  Web Front-end  >  CSS图片导航_html/css_WEB-ITnose

CSS图片导航_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:33:371894browse

原理:通过CSS图片背景的position定位,来实现图片导航;

<!DOCTYPE html><br /><html><br /><head lang="en"><br />    <meta charset="UTF-8"><br />    <title></title><br />    <style><br />        * {<br />            margin: 0;<br />            padding: 0;<br />        }<br /><br />        ul {<br />            border: 1px solid red;<br />            float: right;<br />        }<br /><br />        li {<br />            margin-right: 20px;<br />            float: left;<br />            list-style: none;<br />        }<br /><br />        a {<br />            text-decoration: none;<br />            width: 40px;<br />            height: 20px;<br />            display: block;<br />        }<br /><br />        .book {<br />            background: url("../../image/anony_nav_logo4.png") 0 0 no-repeat;<br />        }<br /><br />        .movie {<br />            background: url("../../image/anony_nav_logo4.png") -60px 0 no-repeat;<br />        }<br /><br />        .music {<br />            background: url("../../image/anony_nav_logo4.png") -120px 0 no-repeat;<br />        }<br /><br />        .group {<br />            background: url("../../image/anony_nav_logo4.png") -180px 0 no-repeat;<br />        }<br />        .fm {<br />            width: 80px;<br />            background: url("../../image/anony_nav_logo4.png") -240px 0 no-repeat;<br />        }<br />        .local {<br />            background: url("../../image/anony_nav_logo4.png") -340px 0 no-repeat;<br />        }<br /><br />        .place {<br />            background: url("../../image/anony_nav_logo4.png") -400px 0 no-repeat;<br />        }<br />    </style><br /></head><br /><body><br />    <ul><br />        <li><a class="book" href=""></a></li><br />        <li><a class="movie" href=""></a></li><br />        <li><a class="music" href=""></a></li><br />        <li><a class="group" href=""></a></li><br />        <li><a class="fm" href=""></a></li><br />        <li><a class="local" href=""></a></li><br />        <li><a class="place" href=""></a></li><br />    </ul><br /></body><br /></html>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn