Bootstrap媒体对象学习使用

Bootstrap媒体对象的学习使用,供大家参考,具体内容如下

基本结构:

rush:xhtml;">
媒体对象

<div class="media-body">
<h4 class="media-heading">媒体标题
这是一些示例文本。这是一些示例文本。
这是一些示例文本。这是一些示例文本。

rush:xhtml;">
    通用的占位符图像
    <div class="media-body"&gt;
      <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
      <p>这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。</p>
    </div>
  • 通用的占位符图像
    <div class="media-body"&gt;
      <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
      这是一些示例文本。这是一些示例文本。
      这是一些示例文本。这是一些示例文本。
    </div>

媒体对象轻量标记、易于扩展的特性是通过向简单的标记应用 class 来实现的。

在 HTML 标签添加以下两种形式来设置媒体对象:

(1).media:该 class 允许将媒体对象里的多媒体(图像、视频、音频)浮动到内容区块的左边或者右边。 (2).media-list:如果你需要一个列表,各项内容是无序列表的一部分,可以使用该 class。可用于评论列表与文章列表

嵌套的媒体对象:

rush:xhtml;">
    通用的占位符图像
    <div class="media-body"&gt;
      <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
      <p>这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。
        这是一些示例文本。这是一些示例文本。</p>
    
      <!-- 嵌套的媒体对象 -->
      <div class="media"&gt;
        <a class="pull-left" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
          <img class="media-object" src="bg.jpg"
             alt="通用的占位符图像"&gt;
        </a>
    
        <div class="media-body"&gt;
          <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;嵌套的媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
          这是一些示例文本。这是一些示例文本。
          这是一些示例文本。这是一些示例文本。
    
          <!-- 嵌套的媒体对象 -->
          <div class="media"&gt;
            <a class="pull-left" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
              <img class="media-object" src="bg.jpg"
                 alt="通用的占位符图像"&gt;
            </a>
            <div class="media-body"&gt;
              <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;嵌套的媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
              这是一些示例文本。这是一些示例文本。
              这是一些示例文本。这是一些示例文本。               
            </div>
          </div>
    
        </div>
      </div>
    
      <!-- 嵌套的媒体对象 -->
      <div class="media"&gt;
        <a class="pull-left" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >
          <img class="media-object" src="bg.jpg"
             alt="通用的占位符图像"&gt;
        </a>
        <div class="media-body"&gt;
          <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;嵌套的媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
          这是一些示例文本。这是一些示例文本。
          这是一些示例文本。这是一些示例文本。
        </div>
      </div>
    </div>

    <li class="media">

    <img class="media-object" src="bg.jpg"
    alt="通用的占位符图像">

    <div class="media-body"&gt;
      <h4 class="media-<a href="https://www.jb51.cc/tag/heading/" target="_blank" class="keywords">heading</a>"&gt;媒体<a href="https://www.jb51.cc/tag/biaoti/" target="_blank" class="keywords">标题</a></h4>
      这是一些示例文本。这是一些示例文本。
      这是一些示例文本。这是一些示例文本。       
    </div>

效果图:

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程之家。

相关文章

Bootstrip HTML 查询搜索常用格式模版 &lt;form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...