Home >Web Front-end >JS Tutorial >Chapter 10: Giant screen header thumbnail and warning box components_javascript skills
Bootstrap, from Twitter, is currently the most popular front-end framework. Bootstrap is based on HTML, CSS, and JAVASCRIPT. It is simple and flexible, making web development faster. Let me first tell you the key points of learning.
Learning points:
1. Giant screen component
2. Header component
3. Thumbnail component
4. Alert box component
In this lesson we will mainly study the four component functions of Bootstrap: giant screen component, page header component, thumbnail component and warning box component.
1. Giant screen component
The giant screen component is mainly used to display key areas of the website.
//在固定的范围内,有圆角 <div class="container"> <div class="jumbotron"> <h2>网站标题</h2> <p> 这是一个学习性的网站! </p> <p> <a href="#" class="btn btn-default">更多内容</a> </p> </div> </div> //100%全屏,没有圆角 <div class="jumbotron"> <div class="container"> <h2>网站标题</h2> <p> 这是一个学习性的网站! </p> <p> <a href="#" class="btn btn-default">更多内容</a> </p> </div> </div>
2. Header component
//增加一些空间 <div class="page-header"> <h1>大标题 <small>小标题</small></h1> </div>
3. Thumbnail component
//缩略图配合响应式 <div class="container"> <div class="row"> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> </div> </div> </div> </div> //自定义内容 <div class="container"> <div class="row"> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> <div class="caption"> <h3>图文并茂</h3> <p> 这是一个图片结合文字的缩略图 </p> <p> <a href="#" class="btn btn-default">进入</a> </p> </div> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> <div class="caption"> <h3>图文并茂</h3> <p> 这是一个图片结合文字的缩略图 </p> <p> <a href="#" class="btn btn-default">进入</a> </p> </div> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> <div class="caption"> <h3>图文并茂</h3> <p> 这是一个图片结合文字的缩略图 </p> <p> <a href="#" class="btn btn-default">进入</a> </p> </div> </div> </div> <div class="col-xs-6 col-md-3 col-sm-4"> <div class="thumbnail"> <img src="img/pic.png" alt=""> <div class="caption"> <h3>图文并茂</h3> <p> 这是一个图片结合文字的缩略图 </p> <p> <a href="#" class="btn btn-default">进入</a> </p> </div> </div> </div> </div> </div>
4. Alert box component
Alert box component is a set of predefined messages.
//基本警告框 <div class="alert alert-success">Bootstrap</div> <div class="alert alert-info">Bootstrap</div> <div class="alert alert-warning">Bootstrap</div> <div class="alert alert-danger">Bootstrap</div> //带关闭的警告框 <div class="alert alert-success"> Bootstrap <button type="button" class="close" data-dismiss="alert"> <span>×</span> </button> </div> //自动适配的超链接 <div class="alert alert-success"> Bootstrap,请到官网 <a href="#" class="alert-link">下载</a> </div>
The above content is the BootStrap component introduced by the editor in Chapter 10: Giant Screen Header Thumbnail and Alert Box Component. I hope it will be helpful to everyone!