[Bootstrap] 4. Typogrphy

What is Typography

When we talk about typography, it‘s a big subject! Which of the following fall under the umbrella of typography?

  • Choosing a font face for our website.
  • Setting the line height of our text.
  • Adding Bootstrap classes to change the style of specific text.
  • Using icons that come from a font file.
  • All of the above

Default Font Size

Bootstrap changes the font-size of our body, which affects quite a lot of the page. Whatfont-size does Bootstrap use by default?

The default font-size is: 14px

Using Glyphicons

If we wanted to use a Glyphicon, what class (or classes) would we need to apply to show the following "plane" icon?

  • glyphicon
  • glyphicon-plane
  • glyphicon and glyphicon-plane
  • plane-glyphicon
  • glyphicon and plane-glyphicon

Finishing Our Footer

Our footer needs a bit more work. How about we add a bit more flair to it by focusing on the typography? Finish the following tasks to finish our footer.

<!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‘>
        <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‘>Take the Tour</button>
          <button type=‘button‘>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=‘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</a></p>
          </div>
          <div class=‘col-md-offset-1 col-sm-2 col-xs-6‘>
            <h4>Links</h4>
            <ul>
              <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>
              <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>
              <li>Orlando, FL</li>
              <li>1-555-blast-off</li>
              <li><a href=‘mailto:[email protected]‘>[email protected]</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>

Let‘s remove all of the bullet icons from our footer. To do this, update all of the unordered lists to use the appropriate Bootstrap class.

Using ‘list-unstyled‘ for the <ul>:

<ul class="list-unstyled">

Time to add some icons! Add the "arrow-right"  icon after the "More About Us" text in the footer.

<p><a href=‘about.html‘>More About Us<i class="glyphicon glyphicon-arrow-right"></i></a></p>

We could add some icons next to our location details in the "Contact Us" section as well, starting with one right before "Orlando, FL".

Head over and check out the available glyphs on the Bootstrap webpage. Look for either a world icon  or a map icon marker  and add that immediately before "Orlando, FL".

<li><i class="glyphicon glyphicon-map-marker"></i>Orlando, FL</li>

Next to our phone number, add the "phone" icon.

<li><i class="glyphicon glyphicon-phone"></i>1-555-blast-off</li>

Next to our email address, add the "envelope" icon.

<li><i class="glyphicon glyphicon-envelope"></i>><a href=‘mailto:[email protected]‘>[email protected]</a></li>

Result:

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

Links: http://getbootstrap.com/components/#glyphicons-glyphs

时间: 2024-10-25 06:50:23

[Bootstrap] 4. Typogrphy的相关文章

Bootstrap + AngularJS+ Ashx + SQL Server/MySQL

去年年底12月,为适应移动端浏览需求,花了1个月时间学习Bootstrap,并将公司ASP网站重构成ASP.NET. 当时采取的网站架构: Bootstrap + jQuery + Ashx + SQL Server 时间紧,没人带,只能硬着头皮,最后如期完成,但是也遗留了几个问题. 问题: 1.页面查询条件太复杂,太多的checkbox,jQuery操作DOM虽然方便,但是组合成json提交给后端还是比较麻烦,有没有天然支持json的前端框架或者脚本语言? html控件做的任何修改,都自动保存

CSS,bootstrap表格控制当td内容过长时用省略号表示,以及在不使用bootstrap时过长也用省略号表示

首先需要在table中设置table-layout:fixed; <table style="table-layout:fixed"></table> 然后在表头th中设置每列的宽度 <table style="table-layout:fixed"> <th width="10%">Title01</th> <th width="20%">Title02

Bootstrap &amp; Font Awesome 学习笔记

学习网站:http://bootstrap.ninghao.net/index.html https://www.freecodecamp.cn http://www.runoob.com/bootstrap/bootstrap-tutorial.html Bootstrap 为快速简单的实施 Web 开发准备的前端架构. Bootstrap将会根据你的屏幕的大小来调整HTML元素的大小 -- 强调 响应式设计的概念. 通过响应式设计,你无需再为你的网站设计一个手机版的.它在任何尺寸的屏幕上看起

第二百三十八节,Bootstrap输入框和导航组件

Bootstrap输入框和导航组件 学习要点: 1.输入框组件 2.导航组件 3.导航条组件 本节课我们主要学习一下Bootstrap的两个个组件功能:输入框组件和导航导航条组件. 一.输入框组件 文本输入框就是可以在<input>元素前后加上文字或按钮,可以实现对表单控件的扩展. 在左侧添加文字 input-group-addon样式class类,写在input同级的span里,给输入框添加一个左片段(Bootstrap)input-group样式class类,写在input外层div里,将

第二百三十一节,Bootstrap 介绍

Bootstrap 介绍 学习要点: 1.Bootstrap 概述 2.Bootstrap 特点 3.Bootstrap 结构 4.创建第一个页面 5.学习的各项准备 本节课我们主要了解一下 Boostrap 历史.特点.用途,以及为什么选择 Boostrap 来开 发我们的 Web 项目. 一.Bootstrap 概述 Bootstrap 是由 Twitter 公司(全球最大的微博)的两名技术工程师研发的一个基于 HTML.CSS.JavaScript 的开源框架.该框架代码简洁.视觉优美,可

Flask---使用Bootstrap新建第一个demo

Flask---使用Bootstrap新建第一个demo 参考自http://www.jianshu.com/p/417bcbad82fb 还有<Flask web开发> 前端用到Bootstrap开源框架,Bootstrap是客户端框架,后台当然就是Flask了. 服务器需要做的只是提供引用了Bootstrap层叠样式表(CSS)和JS文件的html响应,并且在html.css和js代码中实例化需要的组件,这些操作的最理想的执行环境就是模板 关于模板的介绍及其实现原理:https://kb.

bootstrap中的对话框-dialog

<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> <meta http-

bootstrap中的对话框-dialog-2

<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> <meta http-

关于H5框架之Bootstrap的小知识

浏览器支持 旧的浏览器可能无法很好的支持 Bootstrap 支持 Internet Explorer 8 及更高版本的 IE 浏览器 CSS源码研究 我们不是在head里面引入了下面这些文件么 <!-- 新 Bootstrap 核心 CSS 文件 --> <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css"> &l