‘壹’ html如何做轮播图
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CSS3仿JS轮播图</title> <link rel="stylesheet" href="lbimage.css"/> </head> <body> <div id="photo"> <!--//1--> <input type="radio" name="btn" id="img1" checked/> <div> <div><img src="images/img1.jpg"/></div> <div> <label for="img6" class="up leftjianbian"><</label> <label for="img2" class="down rightjianbian">></label> </div> </div> <!--//2--> <input type="radio" name="btn" id="img2"/> <div> <div><img src="images/img2.jpg"/></div> <div> <label for="img1" class="up leftjianbian"><</label> <label for="img3" class="down rightjianbian">></label> </div> </div> <!--//3--> <input type="radio" name="btn" id="img3"/> <div> <div><img src="images/img3.jpg"/></div> <div> <label for="img2" class="up leftjianbian"><</label> <label for="img4" class="down rightjianbian">></label> </div> </div> <!--//4--> <input type="radio" name="btn" id="img4"/> <div> <div><img src="images/img4.jpg"/></div> <div> <label for="img3" class="up leftjianbian"><</label> <label for="img5" class="down rightjianbian">></label> </div> </div> <!--//5--> <input type="radio" name="btn" id="img5"/> <div> <div><img src="images/img5.jpg"/></div> <div> <label for="img4" class="up leftjianbian"><</label> <label for="img6" class="down rightjianbian">></label> </div> </div> <!--//6--> <input type="radio" name="btn" id="img6"/> <div> <div><img src="images/img6.jpg"/></div> <div> <label for="img5" class="up leftjianbian"><</label> <label for="img1" class="down rightjianbian">></label> </div> </div> <div> <label for="img1" id="dot1"></label> <label for="img2" id="dot2"></label> <label for="img3" id="dot3"></label> <label for="img4" id="dot4"></label> <label for="img5" id="dot5"></label> <label for="img6" id="dot6"></label> </div> </div> </body> </html>
css:部分
@charset "utf-8";
body{
background-image: url("images/.jpg");
background-size: cover;
}
img{
width: 850px;
height: 500px;
}
.photo{
width: 900px;
height: 550px;
border: 1px solid #555555;
margin: auto auto;
position: relative;
background: #ffffff;
box-shadow: 0 10px 80px rgba(0,0,0,.6)
}
.photo input{
display: none;
}
.image{
position: absolute;
top: 0px;
left: 0px;
width: 800px;
height: 450px;
margin: 25px 25px;
transform: scale(0);
opacity: 0;
transition: all 0.7s;
}
.image img{
}
.nav label{
width: 150px;
height: 500px;
margin: 25px 25px;
position: absolute;
z-index: 10;
opacity: 0;
display: none;
cursor: pointer;
transition: opacity 0.2s;
color: #ffffff;
font-size: 50px;
line-height: 450px;
text-align: center;
text-shadow: 0 0 15px #555555);
}
.leftjianbian{
background: linear-gradient(right , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -o-linear-gradient(right , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -ms-linear-gradient(right , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -moz-linear-gradient(right , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -webkit-linear-gradient(right , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
}
.rightjianbian{
background: linear-gradient(left , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -o-linear-gradient(left , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -ms-linear-gradient(left , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -moz-linear-gradient(left , rgba(250, 242, 239,0) 1% , rgba(158, 148, 166,0.5) 100%);
background: -webkit-linear-gradient(left , rgba(250, 242, 239,0) 10% , rgba(158, 148, 166,0.5) 100%);
}
.image:hover + .nav label{
opacity: 0.5;
}
.nav label:hover{
opacity: 1;
}
.nav .down{
right: 0;
}
input:checked + .control .image{
opacity: 1;
transform: scale(1);
transition: all 1s;
}
input:checked + .control .nav label{
display: block;
}
.dots{
width:100%;
height: 20px;
position: absolute;
bottom: 30px;
text-align: center;
}
.dot{
width: 10px;
height: 10px;
margin: 0px 5px;
border-radius: 50%;
position: relative;
display: inline-block;
background: rgba(0,0,0,0.3);
}
input#img1:checked ~ .dots label#dot1,
input#img2:checked ~ .dots label#dot2,
input#img3:checked ~ .dots label#dot3,
input#img4:checked ~ .dots label#dot4,
input#img5:checked ~ .dots label#dot5,
input#img6:checked ~ .dots label#dot6{
background: rgba(0,0,0,0.7);
}
‘贰’ html如何制作图片轮播
我推荐你使用SuperSlide插件,layer插件,swiper插件,简单易用兼容性也可以
‘叁’ HTML首页怎么加图片轮播
可以通过输入代码来操作。
‘肆’ 简单的HTML+js图片轮播
h5代码:
<div id="wrap">
<ul id="list">
<li>10</li>
<li>9</li>
<li>8</li>
<li>7</li>
<li>6</li>
<li>5</li>
<li>4</li>
<li>3</li>
<li>2</li>
<li>1</li>
</ul>
</div>
css代码:
<style type="text/css">
@-webkit-keyframes move{
0%{left:-500px;}
100%{left:0;}
}
#wrap{width:600px;height:130px;border:1px solid #000;position:relative;margin:100px auto;
overflow: hidden;}
#list{position:absolute;left:0;top:0;padding:0;margin:0;
-webkit-animation:5s move infinite linear;width:200%;}
#list li{list-style:none;width:120px;height:130px;border:1px solid red;background: pink;
color:#fff;text-align: center;float:left;font:normal 50px/2.5em '微软雅黑';}
#wrap:hover #list{-webkit-animation-play-state:paused;}
</style>
(4)html如何实现图片轮播扩展阅读:
轮播图就是一种网站在介绍自己的主打产品或重要信息的传播方式。说的简单点就是将承载着重要信息的几张图片,在网页的某一部位进行轮流的呈现,从而做到让浏览者很快的了解到网站想要表达的主要信息。以及各种新闻网站的头版头条都是用这种方式呈现的重要信息。
轮播图的实现方式:例如:有5张轮播的图片,每张图片的宽度为1024px、高度为512px.那么轮播的窗口大小就应该为一张图片的尺寸,即为:1024×512。之后将这5张图片0px水平相接组成一张宽度为:5120px,高度依然为:512px。最后将这张合成后的大图每次向左移动1024px即可实现轮播图。
‘伍’ html5如何实现图片轮播
静态获取图片写法,给定图片的个数,用js实现轮播图自动转换。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- *******设置样式********** -->
<style type="text/css">
.show_div{
width: 400px;
height: 400px;
margin: 0 auto;
border: 2px solid block;
overflow: hidden;
}
.scroll_div{
width: 2000px;
height: 400px;
}
.scroll_div img{
width: 400px;
height: 400px;
float: left;
}
</style>
<!-- end -->
</head>
<body>
<div class="show_div">
<div class="scroll_div">
<img src="img/b.jpg" alt="">
<img src="img/c.jpg" alt="">
<img src="img/d.jpg" alt="">
<img src="img/a.jpg" alt="">
<img src="img/b.jpg" alt="">
</div>
</div>
</body>
<!-- *********js代码******** -->
<script type="text/javascript">
var scrollDiv = document.getElementsByClassName("scroll_div")[0];
// 定义初始值
var left =0;
// 定义一个定时器 走一步
function move(){
var timer = setInterval(function(){
left --;
if (left <= -1600) {
left = 0;
}
if (left % -400 == 0) {
clearInterval(timer);
timer = null;
}
scrollDiv.style.marginLeft = left + "px";
},10);
}
// 定义一个定时器 每隔固定时间 走一张
setInterval(function(){
move();
},5000);
</script>
</html>
‘陆’ 怎么用html和css做图片轮播
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>css实现轮播效果</title> <style type="text/css"> .one { position: absolute; width: 500px; height: 400px; overflow: hidden; } .one_cantent img { width: 500px; height: 300px; float: left; } .one_cantent { width: 2500px; height: 400px; position: absolute; left: 0px; animation-name: move; animation-ration: 10s; animation-iteration-count: infinite; } @keyframes move { 0% { left: 0px; } 25% { left: -500px; } 50% { left: -1000px; } 75% { left: -1500px; } 100% { left: -2000px } } </style> </head> <body> <div> <div> <img src="./image/0.jpg"> <img src="./image/1.jpg"> <img src="./image/2.jpg"> <img src="./image/3.jpg"> <img src="./image/4.jpg"> </div> </div> </body> </html>
‘柒’ html中图片轮播怎么弄
一、数字键控制代码:
<divstyle="position:relative;top:-50px;left:240px;">
<ahref="javascript:show(1)"><spanid="I1"style="width:18px;text-align:left;background:gray">1</span></a>
<ahref="javascript:show(2)"><spanid="I2"style="width:18px;text-align:left;background-color:gray">2</span></a>
<ahref="javascript:show(3)"><spanid="I3"style="width:18px;text-align:left;background-color:gray">3</span></a>
<ahref="javascript:show(4)"><spanid="I4"style="width:18px;text-align:left;background-color:gray">4</span></a>
<ahref="javascript:show(5)"><spanid="I5"style="width:18px;text-align:left;background-color:gray">5</span></a>
<ahref="javascript:show(6)"><spanid="I6"style="width:18px;text-align:left;background-color:gray">6</span></a></div>
<scriptlanguage="javaScript">
varnowIndex=1;
varmaxIndex=6;
functionshow(index)
{
if(Number(index)){
clearTimeout(theTimer);
nowIndex=index;
}
for(vari=1;i<(maxIndex+1);i++){
if(i==nowIndex)
{document.getElementById('pic'+nowIndex).style.display='';
document.getElementById('I'+nowIndex).style.backgroundColor='red';}
else
{document.getElementById('pic'+i).style.display='none';
document.getElementById('I'+i).style.backgroundColor='gray';}
}{
if(nowIndex==maxIndex)
nowIndex=1;
else
nowIndex++;
}
theTimer=setTimeout('show()',3000);
}
</script>
</div>
二、图片自动播放:
<divid="butong_net_left"style="overflow:hidden;width:1000px;">
<tablecellpadding="0"cellspacing="0"border="0">
<tr><tdid="butong_net_left1"valign="top"align="center">
<tablecellpadding="2"cellspacing="0"border="0">
<tralign="center">
‘捌’ HTML中的图片轮播怎么做
可以上jquery插件库这个网站看看,大部分资源是免费的。轮播图也有好多。
bootstrap也提供轮播模板。
自己写的话,假如放3张轮播图,pic1,pic2,pic3。创建一个ul,ul中放5张图片,顺序是pic3,pic1,pic2,pic3,pic1,这样衔接起来。设置ul的宽度是500%,li的宽度是20%,这样图片就能一字排开,设置ul的父元素的样式为overflow:hidden;再用CSS3的动画属性,让li中的图片元素位移或者让ul位移。