您现在的位置:首页 >> 前端 >> 内容

用bootstrap进行轮播图的制作

时间:2017/1/7 9:23:00 点击:

  核心提示:轮播图的制作Bootstrap 轮播(Carousel)插件是一种灵活的响应式的向站点添加滑块的方式。除此之外,内容也是足够灵活的,可以是图像、内嵌框架、视频或者其他您想要放置的任何类型的内容。!DO...

轮播图的制作

Bootstrap 轮播(Carousel)插件是一种灵活的响应式的向站点添加滑块的方式。除此之外,内容也是足够灵活的,可以是图像、内嵌框架、视频或者其他您想要放置的任何类型的内容。

<!DOCTYPE html>  
<html lang="zh-cn">  
<head>  
    <meta charset="utf-8">  
    <meta http-equiv="X-UA-Compatible" content="IE=edge">  
    <meta name="viewport" content="width=device-width, initial-scale=1">  
    <title>轮播图</title>  
  
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />  
</head>  
<style>  
    .carousel {  
        height: 500px;  
    }  
    .carousel .item {  
        height: 500px;  
    }  
    .carousel .item img {  
        width: 100%;  
    }  
</style>  
<body>  
<p id="carousel-example-generic" class="carousel slide" data-ride="carousel">  
    <!-- Indicators轮播指标 -->  
    <ol class="carousel-indicators">  
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>  
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>  
        <li data-target="#carousel-example-generic" data-slide-to="2"></li>  
    </ol>  
  
    <!-- Wrapper for slides 轮播项目-->  
    <p class="carousel-inner" role="listbox">  
        <p class="item active">  
            <img src=/uploadfile/2017/0107/20170107114633625.jpg" alt="...">  
            <p class="carousel-caption">  
                11 英寸 MacBook Air 充电一次可运行长达 9 小时,而 13 英寸机型则可运行长达 12 小时。  
            </p>  
        </p>  
        <p class="item">  
            <img src=/uploadfile/2017/0107/20170107114633596.jpg" alt="...">  
            <p class="carousel-caption">  
                无论是什么任务,配备 Intel HD Graphics 5000 图形处理器的第四代 Intel Core 处理器都能应对自如。  
            </p>  
        </p>  
        <p class="item">  
            <img src=/uploadfile/2017/0107/20170107114633944.jpg" alt="...">  
            <p class="carousel-caption">  
                有了新一代 802.11ac 技术,MacBook Air 令 Wi-Fi 速度超越极限。  
            </p>  
        </p>  
    </p>  
  
    <!-- Controls -->  
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">  
        <span class="glyphicon glyphicon-chevron-left"></span>  
        <span class="sr-only">Previous</span>  
    </a>  
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">  
        <span class="glyphicon glyphicon-chevron-right"></span>  
        <span class="sr-only">Next</span>  
    </a>  
</p>  
  
  
<script src="https://libs.baidu.com/jquery/1.9.0/jquery.js"></script>  
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>  
</body>  
</html>

Tags:用B BO OO OT 
作者:网络 来源:bobo1356的博