首頁 > web前端 > html教學 > Chapter 2 unit 1 of Bootstrap-Bootstrap CSS_html/css_WEB-ITnose

Chapter 2 unit 1 of Bootstrap-Bootstrap CSS_html/css_WEB-ITnose

WBOY
發布: 2016-06-24 12:06:18
原創
1479 人瀏覽過

       Hello ,dear readers, today bootstrap css will be discussed, though many references quoted from this book , examples and demos will be added in later blogs.

  1.        Typography

       Starting with typography, Bootstrap uses Helvetica Neue, Helvetica, Arial, and sansserif in its default font stack.here,we can know the types of defalut fonts in Bootstrap.

if these fonts above are not installed in your computer and broswer, and  sansserif  will be used as its default font and showed to you.  All body copy has the font-size set at 14

pixels, with the line-height set at 20 pixels. The

tag has a margin-bottom of 10 pixels, or half the line-height(5 pixels).

       1.1     headings

       All six standard heading levels have been styled in Bootstrap range from

to

  with the

at 36 pixels tall

, and the
down to 12 pixels
(for reference,

default body text is 14 pixels tall). in order  to add an inline subheading to any of the headings ,you can add a tag  around to create a subheading and make its color

lighter than the  parent heading.

      1.2    lead body copy

       To add some emphasis to a paragraph, add class="lead" 。This will give you larger font size, lighter weight, and a taller line height. This is generally used for

the first few paragraphs in a section, but it can really be used anywhere.


     1.3    Emphasis

     In addition to using the tag within headings, as discussed above, you can also use it with body copy. When is applied to body text, the font shrinks to

85% of  its original size.

      1.4    Bold

    To add emphasis to text, simply wrap it in a tag. This will add fontweight:bold; to the selected text.

      1.5   Italics

      For italics, wrap your content in the tag. The term “em” derives from the word “emphasis” and is meant to add stress to your text.

      HERE ,A NEW QUESTATION WILL BE ASKED,AND THEN I WILL FIND AN ANSWER FOR IT.

1.why not just use the or tags instead of or ?

      1.6   Emphasis Classes


     Along with and , Bootstrap offers a few other classes that can be used toprovide emphasisThese could be applied to paragraphs or spans:
   

This content is muted


    

This content carries a warning class


   

This content carries an error class


   

This content carries an info class


   

This content carries a success class


   

This content has emphasis, and can be bold

     1.6.1 Abbreviations(中文:缩略词)


     The HTML element provides markup for abbreviations or acronyms, like WWW or HTTP.By marking up abbreviations, you can give useful
information to browsers, spell checkers, translation systems, or search engines. Bootstrap styles elements with a light dotted border along the bottom and reveals
the full text on hover (as long as you add that text to the title attribute): RSS.

    1.6.2 Addresses


    Adding

elements to your page can help screen readers and search engines locate any physical addresses and phone numbers in the text 。It can also be used to mark up email addresses. Since the
defaults to display:block; you’ll need to use
tags to add line breaks to the enclosed address text (e.g., to split the street address and city onto separate lines):



   O'Reilly Media, Inc.
1005 Gravenstein HWY North
Sebastopol, CA 95472

   P: (707) 827-7000


    Jake Spurlock

    flast@oreilly.com

   1.6.3 Blockquotes


   To add blocks of quoted text to your document?or for any quotation that you want to set apart from the main text flow?add the

tag around the text. For best
results, and for line breaks, wrap each subsection in a

tag. Bootstrap’s default styling indents the text and adds a thick gray border along the left side. To identify the source of the quote, add the tag, then add the source’s name wrapped in a tag before closing the tag:



 

That this is needed, desperately needed, is indicated by the incredible uptake of Bootstrap. I use it in all the server software I'm working on. And it shows through in the templating language I'm developing, so everyone who uses it will find it's "just there" and works, any time you want to do a Bootstrap technique. Nothing to do,
no libraries to include. It's as if it were part of the hardware. Same approach that Apple took with the Mac OS in 1984.


      Developer of RSS, Dave Winer

   1.7 Lists

   ul    ol    dl

 

    1.7.1 Unordered list


    If you have an ordered list that you would like to remove the bullets from, add class="unstyled" to the opening

    tag :


      

    Favorite Outdoor Activities


        

            
    • Backpacking in Yosemite

    •       
    • Hiking in Arches
                

                     
      • Delicate Arch

      •               
      • Park Avenue

      •           

            

    •       
    • Biking the Flintstones Trail

    •    

        1.7.2 Ordered list


        An ordered list is a list that falls in some sort of sequential order and is prefaced by numbers rather than bullets (see Figure 2-10). This is handy when you want to build a
    list of numbered items like a task list, guide items, or even a list of comments on a blog post:


        

    Self-Referential Task List


        

           
  1. Turn off the internet.

  2.        
  3. Write the book.

  4.        
  5. ... Profit?

  6.     

 

      1.7.3 Definition list


      The third type of list you get with Bootstrap is the definition list. The definition list  differs from the ordered and unordered list in that instead of just having a block-level

  • element, each list item can consist of both the
    and the
    elements.
  • stands for “definition term,” and like a dictionary
    , this is the term (or phrase) that is being defined. Subsequently, the
    is the definition of the
    .
    A lot of times in markup, you will see people using headings inside an unordered list. This works, but may not be the most semantic(语义学的 )way to mark up the text. A better method would be creating a

    and then styling the
    and
    as you would the heading and the text .That being said, Bootstrap offers some clean default styles and an option for a side-by-side layout of each definition:

     

    Common Electronics Parts


       

        
    LED

       
    A light-emitting diode (LED) is a semiconductor light source.

        
    Servo

       
    Servos are small, cheap, mass-produced actuators used for radio control and small robotics.

       

      To change the

    to a horizontal layout, with the
    on the left side and the
    on the right, simply add class="dl-horizontal" to the opening tag

     

    來源:php.cn
    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    熱門教學
    更多>
    最新下載
    更多>
    網站特效
    網站源碼
    網站素材
    前端模板