首页 > Web开发 > 详细

html幻灯效果页面

时间:2014-05-17 04:01:11      阅读:418      评论:0      收藏:0      [点我收藏+]

方式一:

bubuko.com,布布扣
<!DOCTYPE HTML>
<html>
  <head>
  <style>
 
  #cont {
  position: relative;
  height: 300px;
  }
img {
      position: absolute;
      width: 400px;
      height: 300px;
      z-index: 1;
    }
img:first-child,
img:target {
      z-index: 2;
    }

#pag {
    width:400px;
}
 
  </style>
  </head>
  <body>
  <div id="cont">
      <img id="img1" src="images/1.JPG">
      <img id="img2" src="images/2.JPG">
      <img id="img3" src="images/3.JPG">
      <img id="img4" src="images/4.JPG">
    </div>
    <div id="pag" align="center">
      <a href="#img1">1</a>
      <a href="#img2">2</a>
      <a href="#img3">3</a>
      <a href="#img4">4</a>
    </div>
  </body>
</html>
bubuko.com,布布扣

bubuko.com,布布扣

 

方式二:

bubuko.com,布布扣
<!doctype html>
<html>
  <head>
    <style>
    img {
      display: none;
      width: 400px;
      height: 300px;
    }
 
    input:checked + img {
      display: block;
    }
 
    input {
      position: absolute;
      left: -9999px;
    }
 
    label {
      cursor: pointer;
    }
    #pag{
        width:400px;
    }
    </style>
  </head>
  <body>
    <div id="cont">
      <input id="img1" name="img" type="radio" checked="checked">
      <img src="images/1.JPG">
      <input id="img2" name="img" type="radio">
      <img src="images/2.JPG">
      <input id="img3" name="img" type="radio" checked="checked">
      <img src="images/3.JPG">
      <input id="img4" name="img" type="radio">
      <img src="images/4.JPG">
    </div>
    <div id="pag" align="center">
      <label for="img1">1</label>
      <label for="img2">2</label>
      <label for="img3">3</label>
      <label for="img4">4</label>
    </div>
  </body>
</html>
bubuko.com,布布扣

bubuko.com,布布扣

html幻灯效果页面,布布扣,bubuko.com

html幻灯效果页面

原文:http://www.cnblogs.com/wishyouhappy/p/3724803.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!