• bootstrap注意事项(二)


    1.内联子标题

    在标题内还可以包含 <small> 标签或赋予 .small 类的元素,可以用来标记副标题。

     <!DOCTYPE html>

    1. <html>
    2. <head>
    3. <title>Bootstrap 实例 - 内联子标题</title>
    4. <link href="/stylesheets/bootstrap.min.css" rel="stylesheet">
    5. </head>
    6. <body>
    7. <h1>我是标题1 h1. <small>我是副标题1 h1</small></h1>
    8. <h2>我是标题2 h2. <small>我是副标题2 h2</small></h2>
    9. <h3>我是标题3 h3. <small>我是副标题3 h3</small></h3>
    10. <h4>我是标题4 h4. <small>我是副标题4 h4</small></h4>
    11. <h5>我是标题5 h5. <small>我是副标题5 h5</small></h5>
    12. <h6>我是标题6 h6. <small>我是副标题6 h6</small></h6>
    13. </body>
    14. </html>

    页面主体

    Bootstrap 将全局 font-size 设置为 14px,line-height 设置为 1.428。这些属性直接赋予 <body> 元素和所有段落元素。另外,<p> (段落)元素还被设置了等于 1/2 行高(即 10px)的底部外边距(margin)。

    中心内容

    通过添加 .lead 类可以让段落突出显示。

    没加.lead

    这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。

    加了lead:

    这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。

    这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。

    这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。

    这是一个演示引导主体副本用法的实例。这是一个演示引导主体副本用法的实例。

    使用 Less 工具构建

    variables.less 文件中定义的两个 Less 变量决定了排版尺寸:@font-size-base 和 @line-height-base。第一个变量定义了全局 font-size 基准,第二个变量是 line-height 基准。我们使用这些变量和一些简单的公式计算出其它所有页面元素的 margin、 padding 和 line-height。自定义这些变量即可改变 Bootstrap 的默认样式。

    2.内联文本元素

    Marked text

    突出运行文本由于在另一个语境的相关性,使用<mark>标记。

    1. You can use the mark tag to <mark>highlight</mark> text.
    2. You can use the mark tag to highlight text. 标记文本

    被删除的文本

    对于被删除的文本使用 <del> 标签。

    1. <del>This line of text is meant to be treated as deleted text.</del>
    2. This line of text is meant to be treated as deleted text.被删除的文本

    无用文本

    对于没用的文本使用 <s> 标签。

    1. <s>This line of text is meant to be treated as no longer accurate.</s>
    2. This line of text is meant to be treated as no longer accurate.无用文本

    插入文本

    额外插入的文本使用 <ins> 标签。

    1. <ins>This line of text is meant to be treated as an addition to the document.</ins>
    2. This line of text is meant to be treated as an addition to the document.插入文本

    带下划线的文本

    为文本添加下划线,使用 <u> 标签。

    1. <u>This line of text will render as underlined</u>
    2. This line of text will render as underlined带下划线的文本

    小号文本

    对于不需要强调的inline或block类型的文本,使用 <small> 标签包裹,其内的文本将被设置为父容器字体大小的 85%。标题元素中嵌套的 <small>元素被设置不同的 font-size 。

    你还可以为行内元素赋予 .small类以代替任何 <small> 元素。

    1. <small>This line of text is meant to be treated as fine print.</small>
    2. This line of text is meant to be treated as fine print.小号文本

    着重

    通过增加 font-weight 值强调一段文本。

    1. The following snippet of text is<strong>rendered as bold text</strong>
    2. The following snippet of text is rendered as bold text.着重

    斜体

    用斜体强调一段文本。

    1. The following snippet of text is <em>rendered as italicized text</em>.
    2. The following snippet of text is rendered as italicized text.斜体

    Alternate elements

    在 HTML5 中可以放心使用 <b> 和 <i> 标签。<b> 用于高亮单词或短语,不带有任何着重的意味;而 <i> 标签主要用于发言、技术词汇等。

    3.改变大小写

    通过这几个类可以改变文本的大小写。

    1. <p class="text-lowercase">Lowercased text.</p>  lowercased text.
    2. <p class="text-uppercase">Uppercased text.</p>  UPPERCASED TEXT.
    3. <p class="text-capitalize">Capitalized text.</p>   Capitalized Text.

    4.缩写

    当鼠标悬停在缩写和缩写词上时就会显示完整内容,Bootstrap 实现了对 HTML 的 <abbr> 元素的增强样式。缩略语元素带有 title 属性,外观表现为带有较浅的虚线框,鼠标移至上面时会变成带有“问号”的指针。如想看完整的内容可把鼠标悬停在缩略语上(对使用辅助技术的用户也可见), 但需要包含 title 属性。

    基本缩略语

    1. <abbr title="attribute">attr</abbr>

    首字母缩略语

    为缩略语添加 .initialism 类,可以让 font-size 变得稍微小些。

    1. <abbr title="HyperText Markup Language" class="initialism">HTML</abbr>

    <!DOCTYPE HTML>
    <html>
    <head>
    <link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
    </head>
    <body>
    <div class="container">
    <p>An abbreviation of the word attribute is <abbr title="attribute">attr</abbr>.</p>
    </div>
    </body>
    </html>

    5.地址 

    让联系信息以最接近日常使用的格式呈现。在每行结尾添加 <br> 可以保留需要的样式。

    <!DOCTYPE HTML>
    <html>
    <head>
    <link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
    </head>
    <body>
    <div class="container">
    <address>
    <strong>Twitter, Inc.</strong><br>
    795 Folsom Ave, Suite 600<br>
    San Francisco, CA 94107<br>
    <abbr title="Phone">P:</abbr> (123) 456-7890
    </address>
    <address>
    <strong>Full Name</strong><br>
    <a href="mailto:#">first.last@example.com</a>
    </address>
    </div>
    </body>
    </html>

    效果:

    Twitter, Inc.
    795 Folsom Ave, Suite 600
    San Francisco, CA 94107
    P: (123) 456-7890
     
    Full Name
    first.last@example.com
     
     

    无样式列表

    移除了默认的 list-style 样式和左侧外边距的一组元素(只针对直接子元素)。这是针对直接子元素的,也就是说,你需要对所有嵌套的列表都添加这个类才能具有同样的样式。

    1. <ul class="list-unstyled">
    2. <li>...</li>
    3. </ul>

    内联列表

    通过设置 display: inline-block; 并添加少量的内补(padding),将所有元素放置于同一行。

    1. <ul class="list-inline">
    2. <li>...</li>
    3. </ul>

    描述

    带有描述的短语列表。

    1. <dl>
    2. <dt>...</dt>
    3. <dd>...</dd>
    4. </dl>

    自动截断

    通过 text-overflow 属性,水平排列的描述列表将会截断左侧太长的短语。在较窄的视口(viewport)内,列表将变为默认堆叠排列的布局方式。

  • 相关阅读:
    linux系统中完整删除逻辑卷、卷组、物理劵
    linux系统中逻辑卷缩容步骤
    问题
    新的一天开始了
    Solaris的版本命名
    Sun公司的操作系统:Solaris简介
    培训经历:Awakening the Dragon Within
    大本计算机专业该怎么学习?
    windbg 使用
    ubuntu 常用技巧
  • 原文地址:https://www.cnblogs.com/qiuzhimutou/p/4741035.html
Copyright © 2020-2023  润新知