Bootstrap3.0 learning (1)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:53:42
Original
1257 people have browsed it

Bootstrap is an open source toolkit for front-end development exited by Twitter. It was developed by Twitter designers Mark Otto and Jacob Thornton and is a CSS/HTML framework. Bootstrap provides elegant HTML and CSS specifications, which are written in dynamic CSS language and Less. Bootstrap has been very popular since its launch and has been a popular open source project on GitHub, including NASA's MSNBC (Microsoft National Broadcasting Company) Breaking News.

                                                                                             since 🎜>

Preparation:

1. Download the bootstrap file from the official website http://v3.bootcss.com/getting-started/

2. The website references the bootstrap file

Note: The bootstrap script is based on jquery. You need to quote jquery before referencing bootstrap.min.js. The jquery version supports Version 1.9.1 or above.

1: Navigation bar

 

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">    <div class="container">        <ul class="nav nav-pills" >            <li class="dropdown">                <a class="dropdown-toggle" data-toggle="dropdown" href="#">首页 <span class="caret"></span></a>                <ul class="dropdown-menu">                    <li><a href="#">Home</a></li>                    <li><a href="#">Profile</a></li>                    <li><a href="#">Messages</a></li>                </ul>            </li>            <li><a href="#">Home</a></li>            <li><a href="#">Home</a></li>            <li><a href="#">Home</a></li>        </ul>    </div>    </nav>
Copy after login

The effect after running is:

Two: Carousel carousel

<div id="myCarousel" class="carousel slide" data-ride="carousel">        <!--轮播指标-->        <ol class="carousel-indicators">            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>            <li data-target="#myCarousel" data-slide-to="1"></li>            <li data-target="#myCarousel" data-slide-to="2"></li>        </ol>        <!--轮播项目-->        <div class="carousel-inner" role="listbox">            <div class="item active">                <img src="../Img/xx.png" />                <div class="container">                    <div class="carousel-caption">标题1</div>                </div>            </div>            <div class="item">                <img src="../Img/xx.png" />                <div class="container">                    <div class="carousel-caption">标题2</div>                </div>            </div>            <div class="item">                <img src="../Img/xx.png" />                <div class="container">                    <div class="carousel-caption">标题3</div>                </div>            </div>        </div>        <!--轮播导航-->        <a class="carousel-control left" href="#myCarousel" data-slide="prev">            <span class="glyphicon glyphicon-chevron-left"></span>            <span class="sr-only">Previous</span>        </a>        <a class="carousel-control right" href="#myCarousel" data-slide="next">            <span class="glyphicon glyphicon-chevron-right"></span>            <span class="sr-only">Next</span>        </a>    </div>
Copy after login

The running effect is as shown below:

Usage:

Through the data attribute: Use the data attribute to control the position of the carousel.

The attribute data-slide accepts the keyword prev or next, which is used to change the position of the slide relative to the current position.

Use the data-ride="carousel" attribute to mark the carousel to start playing animation when the page loads.

Via javascript: Can be called manually via $('.carousel').carousel().

For specific usage methods, you can go to bootstrap official website http://www.bootcss.com/

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!