Element Identification

There are a number of classes in Bootstrap that help add prominence to a page by adding a background color and a rounded border like the below example.

Styling for this element is due to what Bootstrap class?

  • container

  • well

  • btn

  • lead

Choose a Well

Which of the following is NOT a Bootstrap class we could use to style well padding?

  • well

  • well-sm

  • well-md

  • well-lg

Button Element

It's a best practice to use a tags for all buttons, including Bootstrap's buttons, because browsers expect them to be clicked.

  • true

  • false

Button Color

Bootstrap has some very striking button colors that can be used by adding an additional class to any button. We really want the following button to stand out without conveying contextual information and have it styled appropriately.

The button class used to add color in this case is: btn-primary

Check out the following button element. It's a destructive action, and we've given it a class to indicate that clicking on it will perform a potentially negative action. What Bootstrap class is being used to set its color?

The button class used to add this color is: btn-danger

Comparing Transport Systems

Like any main sales page, our site needs a good way for travelers to compare the features and prices between the different transport systems. The HTML for this was added, but the Bootstrap classes to make it look nice still need to be included. Follow the tasks to have the Transporter, Space Elevator, and RocketBus sections stand out.

<!DOCTYPE html>
<html>
<head>
<title>Blasting Off With Bootstrap</title>
<link href='css/bootstrap.min.css' rel='stylesheet'>
<link href='css/main.css' rel='stylesheet'>
</head>
<body>
<div class='container'>
<div class='row'>
<div class='col-md-12'>
<h1>Blasting Off With Bootstrap</h1>
</div>
</div> <div class='row well well-lg'>
<div class='col-md-6'>
<h2>The Fastest Way to Space</h2>
<p class='lead'>Make your way to space in the comfort of your own rocket, elevator or transporter.</p>
<button type='button' class='btn btn-lg btn-default'>Take the Tour</button>
<button type='button' class='btn btn-lg btn-primary'>Book Tickets Now</button>
</div>
<div class='col-md-6 visible-md visible-lg'>
<img src='images/img-header.jpg' alt='Blast off with Bootstrap' />
</div>
</div> <div class='row text-center features'>
<div class='col-sm-4 col-xs-10 col-xs-offset-1 col-sm-offset-0'>
<i class='glyphicon glyphicon-briefcase'></i>
<h3>Book Today!</h3>
<p>Even if you're traveling tomorrow, you can still get tickets today. We have a number of conveniently located ports around the globe to service everyone.</p>
</div> <div class='col-sm-4 col-xs-6'>
<i class='glyphicon glyphicon-random'></i>
<h3>Go Anywhere</h3>
<p>If you need to get to space today, why not try out a transporter? Despite the claims, there are have been no deaths in the last 6 weeks!</p>
</div> <div class='col-sm-4 col-xs-6'>
<i class='glyphicon glyphicon-send'></i>
<h3>RocketBus&reg;</h3>
<p>For cheapest fares, catch the next RocketBus&reg; to the stars. Cheaper on your wallet, and easiest way to make friends.</p>
</div>
</div>
</div>
<div class='quote'>
<div class='container'>
<blockquote>
<p>Any sufficiently advanced technology is indistinguishable from magic.</p>
<footer>Arthur C. Clarke in <cite title="Source Title">Profiles of the Future</cite></footer>
</blockquote>
</div>
</div> <div class='container transport-systems'>
<div class='row'>
<div class='col-md-10 col-md-offset-1'>
<h2>Our Transport Systems</h2>
<p>Learn more about our transport systems to find out which one is right for you. Pick out the mode of transport that works for your budget and risk level.</p>
</div>
</div> <div class='row'>
<div class='transporter col-md-3 col-md-offset-1'>
<h3>Transporter</h3>
<ul>
<li>8 second travel time</li>
<li>Chance of death only 1 in 7,593</li>
<li>Low price of only $15.99!</li>
</ul>
<p><button><i class='glyphicon glyphicon-transfer'></i> Beam Me Up!</button></p>
</div>
<div class='space-elevator col-md-3 col-md-offset-1'>
<h3>Space Elevator</h3>
<ul>
<li>8 hour scenic ride</li>
<li>Only 1 horrific death per 12,456</li>
<li>Only $45.99 if you book today!</li>
</ul>
<p><button><i class='glyphicon glyphicon-sort'></i> Board the Elevator!</button></p>
</div>
<div class='rocketbus col-md-3 col-md-offset-1'>
<h3>RocketBus</h3>
<ul>
<li>8 minute scenic ride</li>
<li>Plunging death rate of under 1/100k</li>
<li>$74.99 lets you blast off today!</li>
</ul>
<p><button><i class='glyphicon glyphicon-plane'></i> Blast Off!</button></p>
</div>
</div>
</div> <div class='footer'>
<div class='container'>
<div class='row'>
<div class='col-md-3 col-sm-4 col-xs-6'>
<h4>Who We Are</h4>
<p><i>Blasting Off With Bootstrap</i> is the fastest way to space. <a href='tickets.html'>Book your ticket today</a>!</p>
<p><a href='about.html'>More About Us <i class='glyphicon glyphicon-arrow-right'></i></a></p>
</div> <div class='col-md-offset-1 col-sm-2 col-xs-6'>
<h4>Links</h4>
<ul class='list-unstyled'>
<li><a href='/'>Home</a></li>
<li><a href='tickets.html'>Tickets</a></li>
<li><a href='stations.html'>Stations</a></li>
</ul>
</div> <div class='clearfix visible-xs'></div> <div class='col-sm-2 col-xs-6'>
<h4>Stay in Touch</h4>
<ul class='list-unstyled'>
<li><a href='about.html'>About</a></li>
<li><a href='contact.html'>Contact Us</a></li>
<li><a href='/blog'>Blog</a></li>
<li><a href='http://twitter.com/codeschool'>Twitter</a></li>
<li><a href='http://facebook.com/codeschool'>Facebook</a></li>
</ul>
</div> <div class='col-md-3 col-md-offset-1 col-sm-4 col-xs-6'>
<h4>Contact Us</h4>
<ul class='list-unstyled'>
<li><i class='glyphicon glyphicon-globe'></i> Orlando, FL</li>
<li><i class='glyphicon glyphicon-phone'></i> 1-555-blast-off</li>
<li><i class='glyphicon glyphicon-envelope'></i> <a href='mailto:blastingoff@codeschool.com'>blastingoff@codeschool.com</a></li>
</ul>
<p>Blasting Off With Bootstrap &copy;2214.</p>
</div>
</div>
</div>
</div> <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<script src='js/bootstrap.min.js'></script>
</body>
</html>

It doesn't make sense to left align our 3 transport systems. Center the text in all cells within that .row.

<div class='row text-center'>
<div class='transporter col-md-3 col-md-offset-1'>
<h3>Transporter</h3>
<ul>
<li>8 second travel time</li>
<li>Chance of death only 1 in 7,593</li>
<li>Low price of only $15.99!</li>
</ul>
<p><button><i class='glyphicon glyphicon-transfer'></i> Beam Me Up!</button></p>
</div>

Like the lists in our footer, we don't need bullet icons next to our lists here either. Remove them from each of the lists in the transport systems section.

<ul class="list-unstyled">

Each of the three transport systems could stand out a bit more. Add a class to eachdiv that would change the background color and add a rounded border to each. Within this area, include the title (like "Transporter") and the list of items.

        <div class='transporter col-md-3 col-md-offset-1 well'>
<h3>Transporter</h3>
<ul class="list-unstyled">
<li>8 second travel time</li>
<li>Chance of death only 1 in 7,593</li>
<li>Low price of only $15.99!</li>
</ul>
<p><button><i class='glyphicon glyphicon-transfer'></i> Beam Me Up!</button></p>
</div>

Our unstyled buttons are painful to look at. Add Bootstrap classes to the Transporterbutton to have it use the Bootstrap button styling. Also change the color to be similar to our footer link colors.

If you need a refresher on Bootstrap colors, checkout the Bootstrap Button Documentation.

<button class="btn btn-info"><i class='glyphicon glyphicon-transfer'></i> Beam Me Up!</button>

-----------------

Links:http://getbootstrap.com/css/#buttons

[Bootstrap] 5. Button and well的更多相关文章

  1. Bootstrap风格button

    一直非常喜欢Bootstrap的按钮风格,仿照Bootstrap做了一套按钮.在ie6/7/8/9/10/11.chrome.firefox下能正常使用. ie6/7/8不支持css3的样式.按钮在这 ...

  2. Bootstrap 按钮(Button)插件加载状态

    通过按钮(Button)插件,您可以添加进一些交互.比如控制按钮的状态.或者为其它组件(工具栏)创建按钮组. 加载状态 如需向按钮添加加载状态,只需要简单地向 button 元素添加 data-loa ...

  3. Bootstrap之Button.js

    查看Button.js的源代码 +function ($) { 'use strict'; // BUTTON PUBLIC CLASS DEFINITION // ================= ...

  4. bootstrap的button按钮点击之后会有蓝色边框怎么解决?

    .btn:focus,.btn:active:focus, .btn.active:focus,.btn.focus, .btn:active.focus,.btn.active.focus { ou ...

  5. 基于Bootstrap里面的Button dropdown打造自定义select

    最近工作非常的忙,在对一个系统进行改版.项目后台是MVC1.0开发的,但是前端部分已经改过几个版本,而已之前的设计师很强大,又做设计又做前端开发.而已很时尚和前沿,使用了一直都很热门的Bootstra ...

  6. bootstrap总结

    bootstrap在reset.css文件中设置margin为0,因此其他的标签需要重新设计margin. 1.h <h>标签和普通使用方法一样. 定义了.h1~.h6六个类名,样式和标题 ...

  7. bootstrap加深

    1.安装: bootstrap中文网:http://www.bootcss.com/ bootstrap.css样式:http://v3.bootcss.com/css/#tables class=' ...

  8. Bootstrap之BootstrapDialog

    Make use of Bootstrap's modal more monkey-friendly. 参考地址:http://nakupanda.github.io/bootstrap3-dialo ...

  9. BootStrap 最佳资源合集(转)

    witter BootStrap是一款优秀的前端的框架,称得上是前端的一个框架利器.Web前端开发者每天都在与HTML.CSS.JavaScript打交道,然 而不少人都是在周而复始的写模板.样式和交 ...

随机推荐

  1. javascript 库

    http://overapi.com/javascript/ 查javascript http://slimerjs.org/ 自动测试? http://www.cnblogs.com/lhb25/p ...

  2. Webform——Repeater多表联合显示

    对于一个表里,通过外键连接如何显示另一个表的数据,前Winform里可以用封装类来实现. 对于Webform,可以用封装类,也可以用Repeater的ItemDataBound事件(//在项被绑定数据 ...

  3. 在线API,桌面版,jquery,css,Android中文开发文档,JScript,SQL掌用实例

    学习帮助文档大全 jquery,css,Android中文开发文档,JScript,SQL掌用实例 http://api.jq-school.com/

  4. POJ 2728 Desert King ★(01分数规划介绍 && 应用の最优比率生成树)

    [题意]每条路径有一个 cost 和 dist,求图中 sigma(cost) / sigma(dist) 最小的生成树. 标准的最优比率生成树,楼教主当年开场随手1YES然后把别人带错方向的题Orz ...

  5. 打造自己的reset.css

    http://shawphy.com/2009/03/my-own-reset-css.html 最近我对此观点有所新的看法,可以查看<真的还需要reset.css么?> 0,引言 每每有 ...

  6. linux 查看用户所在组(groups指令的使用) 含实例

    经常将某个文件夹的权限赋给某个用户的时候,也需要配置该用户所在的组,因此,我们需要查看该用户有哪些组,我们可以使用如上命令查看用户所在组 [oracle@gl ~]$ vi /etc/group ro ...

  7. FZU 2105-Digits Count(线段树延时标记)

    题意: 每次操作区间每个数进行一种(&或|.或^ )给定的一个数,到sum时统计给定区间的和. 分析: 这个题让我觉得我的思维很不活跃,对懒惰标记理解,还远远不够,通过这道题我对懒惰标记加深了 ...

  8. IOS 多线程 NSOperation GCD

    1.NSInvocationOperation NSInvocationOperation * op; NSOperationQueue * que = [[NSOperationQueuealloc ...

  9. 一个简单的appium脚本

    这是一个简单的appium脚本,测试amazon购物过程的,过程包括搜索商品,然后从结果列表中选取中意的商品,然后加入购物车,等等. 它是一个最原始的脚本,对测试元素.数据.报告等未作任何的封装,后面 ...

  10. 卡尔曼滤波器【Kalman Filter For Dummies】

    搬砖到此: A Quick Insight     As I mentioned earlier, it's nearly impossible to grasp the full meaning o ...