0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-10 22:24:19 +01:00
Bootstrap/docs/_includes/components/media.html

208 lines
9.2 KiB
HTML
Raw Normal View History

2014-03-17 03:03:53 +01:00
<div class="bs-docs-section">
<h1 id="media" class="page-header">Media object</h1>
<p class="lead">Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.</p>
<h3 id="media-default">Default media</h3>
<p>The default media displays a media object (images, video, audio) to the left or right of a content block.</p>
2014-03-17 03:03:53 +01:00
<div class="bs-example">
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Nested media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
</div>
</div>
<div class="media">
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
</div>
2014-11-22 13:45:32 +01:00
<div class="media-right">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
</div>
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
</div>
2014-11-22 13:45:32 +01:00
<div class="media-right">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
</div>
2014-03-17 03:03:53 +01:00
</div><!-- /.bs-example -->
{% highlight html %}
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img src="..." alt="...">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
...
</div>
</div>
{% endhighlight %}
<p>The classes <code>.pull-left</code> and <code>.pull-right</code> also exist and were previously used as part of the media component, but are deprecated for that use as of v3.3.0. They are approximately equivalent to <code>.media-left</code> and <code>.media-right</code>, except that <code>.media-right</code> should be placed after the <code>.media-body</code> in the html.</p>
<h3 id="media-alignment">Media alignment</h3>
<p>The images or other media can be aligned top, middle, or bottom. The default is top aligned.</p>
<div class="bs-example">
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">Top aligned media</h4>
2014-10-26 02:13:50 +01:00
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left media-middle">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">Middle aligned media</h4>
2014-10-26 02:13:50 +01:00
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left media-bottom">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">Bottom aligned media</h4>
2014-10-26 02:13:50 +01:00
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.</p>
<p>Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
</div>
</div>
</div>
{% highlight html %}
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left media-middle">
<a href="#">
<img src="..." alt="...">
</a>
</div>
<div class="media-body">
<h4 class="media-heading">Middle aligned media</h4>
...
</div>
</div>
2014-03-17 03:03:53 +01:00
{% endhighlight %}
<h3 id="media-list">Media list</h3>
<p>With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).</p>
<div class="bs-example">
<ul class="media-list">
<li class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
<p>Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.</p>
<!-- Nested media object -->
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Nested media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
<!-- Nested media object -->
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Nested media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
</div>
</div>
</div>
</div>
<!-- Nested media object -->
<div class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img data-src="holder.js/64x64" alt="Generic placeholder image">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Nested media heading</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
</div>
</div>
</div>
</li>
</ul>
</div>
{% highlight html %}
<ul class="media-list">
<li class="media">
2014-11-22 13:45:32 +01:00
<div class="media-left">
<a href="#">
<img src="..." alt="...">
</a>
</div>
2014-03-17 03:03:53 +01:00
<div class="media-body">
<h4 class="media-heading">Media heading</h4>
...
</div>
</li>
</ul>
{% endhighlight %}
</div>