css實現圖片閱讀器

來源:互聯網
上載者:User

HTML:

<div id="wrap" >
     
   
      <ul>
           <li><a href="#image1" id="2"><img src="2.png" alt=""/></a></li>
           <li><a href="#image2" id="3"><img src="3.png" alt=""/></a></li>
           <li><a href="#image3" id="4"><img src="4.png" alt=""/></a></li>
           <li><a href="#image4" id="5"><img src="5.png" alt=""/></a></li>
           <li><a href="#image5" id="6"><img src="6.png" alt=""/></a></li>
      </ul>
     

<div id="images">
       <div><a id="image1"></a><img
style="width:500px;height:300px;"src="2.png" alt=""
title=""/></div>
       <div><a id="image2"></a><img
style="width:500px;height:300px;"src="3.png" alt=""
title=""/></div>
       <div><a id="image3"></a><img
style="width:500px;height:300px;"src="4.png" alt=""
title=""/></div>
       <div><a id="image4"></a><img
style="width:500px;height:300px;"src="5.png" alt=""
title=""/></div>
       <div><a id="image5"></a><img
style="width:500px;height:300px;"src="6.png" alt=""
title=""/></div>
      
</div>

</div>

 

 

CSS:

*{
margin:o auto;
padding: 0;}

body {
margin:0;
padding:0;
background-color: #111;
color:#888;}

a{
text-decoration:none;
color:#660066;}

ul{
list-style:none;
float:left;
width:125px;
margin:0 auto;
border-right:5px solid black;

}

ul li{
height:60px;
border-right:10px solid black;
}

ul li a img{
filter:alpha(opacity=40);
width:110px;
opacity:0.4;}

 

height:60px;}

ul li a:hover img{
filter:alpha(opacity=100);
opacity:1.0;  
}

#images {
width:500px;
height:300px;
overflow:hidden;
float:left;
border-right:10px solid black;}

#wrap{
width:700px;
height:300px;

}

所用的圖片為500*300

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.