用CSS做滑動效果的圖片畫廊

來源:互聯網
上載者:User
css

  代碼如下:

<style>
#galleryh {
  padding:0;
  margin:0 auto 5em auto;
  list-style-type:none;
  overflow:hidden;
  width:495px;
  height:240px;
  border:1px solid #888;
  background:#fff url(http://www.alixixi.com/UploadPic/2007-7/200777205617520.gif);
  }
#galleryh li {
  float:left;
  }
#galleryh li a {
  display:block;
  height:240px;
  width:28px;
  float:left;
  text-decoration:none;
  border-right:1px solid #fff;
  cursor:default;
  }
#galleryh li a img {
  width:28px;
  height:240px;
  border:0;
  }
#galleryh li a:hover {
  background:#eee;
  width:320px;
  }
#galleryh li a:hover img {
  width:320px;
  }
</style>
<ul id="galleryh">
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205617821.jpg" alt="#1" title="#1" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205617515.jpg" alt="#2" title="#2" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205617783.jpg" alt="#3" title="#3" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205618477.jpg" alt="#4" title="#4" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205618412.jpg" alt="#5" title="#5" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205618656.jpg" alt="#6" title="#6" /></a></li>
<li><a href="#nogo">
<img src="http://www.alixixi.com/UploadPic/2007-7/200777205618845.jpg" alt="#7" title="#7" /></a></li>
</ul>

<style>#galleryh { padding:0; margin:0 auto 5em auto; list-style-type:none; overflow:hidden; width:495px; height:240px; border:1px solid #888; background:#fff url(http://www.alixixi.com/UploadPic/2007-7/200777205617520.gif); }#galleryh li { float:left; }#galleryh li a { display:block; height:240px; width:28px; float:left; text-decoration:none; border-right:1px solid #fff; cursor:default; }#galleryh li a img { width:28px; height:240px; border:0; }#galleryh li a:hover { background:#eee; width:320px; }#galleryh li a:hover img { width:320px; }</style><ul id="galleryh"><li><a href="#nogo"><img src="200777205617821.jpg" alt="#1" title="#1" /></a></li><li><a href="#nogo"><img src="200777205617515.jpg" alt="#2" title="#2" /></a></li><li><a href="#nogo"><img src="200777205617783.jpg" alt="#3" title="#3" /></a></li><li><a href="#nogo"><img src="200777205618477.jpg" alt="#4" title="#4" /></a></li><li><a href="#nogo"><img src="200777205618412.jpg" alt="#5" title="#5" /></a></li><li><a href="#nogo"><img src="200777205618656.jpg" alt="#6" title="#6" /></a></li><li><a href="#nogo"><img src="200777205618845.jpg" alt="#7" title="#7" /></a></li></ul>

    [Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行]



相關文章

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.