Chapter 2 unit 1 of Bootstrap-Bootstrap CSS

       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 <p> 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 <H1> to <H6>  with the <h1> at 36 pixels tall, and the <h6> 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 <small> 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 <small> tag within headings, as discussed above, you can also use it with body copy. When <small> 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 <strong> tag. This will add fontweight:bold; to the selected text.

      1.5   Italics

      For italics, wrap your content in the <em> 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 <b> or <i> tags instead of<em> or <strong>?

      1.6   Emphasis Classes


     Along with <strong> and <em>, Bootstrap offers a few other classes that can be used toprovide emphasisThese could be applied to paragraphs or spans:
    <p class="muted">This content is muted</p>
    <p class="text-warning">This content carries a warning class</p>
    <p class="text-error">This content carries an error class</p>
    <p class="text-info">This content carries an info class</p>
    <p class="text-success">This content carries a success class</p>
    <p>This content has <em>emphasis</em>, and can be <strong>bold</strong></p>

     1.6.1 Abbreviations(中文:缩略词)


     The HTML <abbr> 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 <abbr> 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 <abbr> title attribute): <abbr title="Real Simple Syndication">RSS</abbr>.

    1.6.2 Addresses


    Adding <address> 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 <address> defaults to display:block; you’ll need to use <br> tags to add line breaks to the enclosed address text (e.g., to split the street address and city onto separate lines):


<address>
   <strong>O‘Reilly Media, Inc.</strong><br>1005 Gravenstein HWY North<br>Sebastopol, CA 95472<br>
   <abbr title="Phone">P:</abbr> <a href="tel:+17078277000">(707) 827-7000</a>
</address>
<address>
    <strong>Jake Spurlock</strong><br>
    <a href="mailto:#">[email protected]</a>
</address>

   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 <blockquote> tag around the text. For best
results, and for line breaks, wrap each subsection in a <p> 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 <small> tag, then add the source’s name wrapped in a <cite> tag before closing the </small> tag:


<blockquote>
  <p>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.</p>
      <small>Developer of RSS, <cite title="Source Title">Dave Winer</cite></small>
</blockquote>

   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 <ul> tag :


   <h3>Favorite Outdoor Activities</h3>
     <ul>
       <li>Backpacking in Yosemite</li>
       <li>Hiking in Arches
           <ul>
              <li>Delicate Arch</li>
              <li>Park Avenue</li>
           </ul>
       </li>
       <li>Biking the Flintstones Trail</li>
    </ul>

    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:


     <h3>Self-Referential Task List</h3>
     <ol>
        <li>Turn off the internet.</li>
        <li>Write the book.</li>
        <li>... Profit?</li>
     </ol>

 

      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 <li> element, each list item can consist of both the <dt> and the <dd> elements. <dt> stands for “definition term,” and like a dictionary, this is the term (or phrase) that is being defined. Subsequently, the <dd> is the definition of the <dt>. 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 <dl> and then styling the <dt> and <dd> 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:

 

<h3>Common Electronics Parts</h3>
    <dl>
    <dt>LED</dt>
    <dd>A light-emitting diode (LED) is a semiconductor light source.</dd>
    <dt>Servo</dt>
    <dd>Servos are small, cheap, mass-produced actuators used for radio control and small robotics.</dd>
    </dl>

  To change the <dl> to a horizontal layout, with the <dt> on the left side and the <dd> on the right, simply add class="dl-horizontal" to the opening tag

 

Chapter 2 unit 1 of Bootstrap-Bootstrap CSS,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。