mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Fixes #14799: Add vertical alignment of image in media component
Signed-off-by: Jenn Dodd <jedodd@pivotal.io>
This commit is contained in:
parent
3bea2a45ef
commit
919b4ccb15
37
dist/css/bootstrap.css
vendored
37
dist/css/bootstrap.css
vendored
@ -4886,29 +4886,34 @@ a.thumbnail.active {
|
|||||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
}
|
}
|
||||||
.media,
|
.media {
|
||||||
.media-body {
|
|
||||||
overflow: hidden;
|
|
||||||
zoom: 1;
|
|
||||||
}
|
|
||||||
.media,
|
|
||||||
.media .media {
|
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
.media .media-right,
|
||||||
|
.media .pull-right {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
.media .media-left,
|
||||||
|
.media .pull-left {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
.media:first-child {
|
.media:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
.media-object {
|
.media .media-left,
|
||||||
display: block;
|
.media .media-right,
|
||||||
|
.media .media-body {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.media .media-middle {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.media .media-bottom {
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
.media-heading {
|
.media-heading {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px 0;
|
||||||
}
|
|
||||||
.media > .pull-left {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.media > .pull-right {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
}
|
||||||
.media-list {
|
.media-list {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
<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>
|
<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>
|
<h3 id="media-default">Default media</h3>
|
||||||
<p>The default media allow to float a media object (images, video, audio) to the left or right of a content block.</p>
|
<p>The default media displays a media object (images, video, audio) to the left or right of a content block.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -16,14 +16,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h4 class="media-heading">Media heading</h4>
|
<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.
|
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">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -33,10 +33,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
<a class="media-right" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="media">
|
||||||
|
<a class="pull-right" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
<a class="pull-left" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading">Deprecated pull-right pull-left example</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><!-- /.bs-example -->
|
</div><!-- /.bs-example -->
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" src="..." alt="...">
|
<img class="media-object" src="..." alt="...">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -44,6 +65,50 @@
|
|||||||
...
|
...
|
||||||
</div>
|
</div>
|
||||||
</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">
|
||||||
|
<a class="media-left" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/40x40" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading">Top aligned media</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">
|
||||||
|
<a class="media-left media-middle" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/40x40" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading">Middle aligned media</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">
|
||||||
|
<a class="media-left media-bottom" href="#">
|
||||||
|
<img class="media-object" data-src="holder.js/40x40" alt="Generic placeholder image">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading">Bottom aligned media</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>
|
||||||
|
{% highlight html %}
|
||||||
|
<div class="media">
|
||||||
|
<a class="media-left media-middle" href="#">
|
||||||
|
<img class="media-object" data-src="..." alt="...">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading">Middle aligned media</h4>
|
||||||
|
...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<h3 id="media-list">Media list</h3>
|
<h3 id="media-list">Media list</h3>
|
||||||
@ -51,7 +116,7 @@
|
|||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<ul class="media-list">
|
<ul class="media-list">
|
||||||
<li class="media">
|
<li class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -59,7 +124,7 @@
|
|||||||
<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>
|
<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 -->
|
<!-- Nested media object -->
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -67,7 +132,7 @@
|
|||||||
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.
|
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 -->
|
<!-- Nested media object -->
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -79,7 +144,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Nested media object -->
|
<!-- Nested media object -->
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
@ -89,21 +154,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="media">
|
|
||||||
<a class="pull-right" href="#">
|
|
||||||
<img class="media-object" data-src="holder.js/64x64" alt="Generic placeholder image">
|
|
||||||
</a>
|
|
||||||
<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>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<ul class="media-list">
|
<ul class="media-list">
|
||||||
<li class="media">
|
<li class="media">
|
||||||
<a class="pull-left" href="#">
|
<a class="media-left" href="#">
|
||||||
<img class="media-object" src="..." alt="...">
|
<img class="media-object" src="..." alt="...">
|
||||||
</a>
|
</a>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
|
37
docs/dist/css/bootstrap.css
vendored
37
docs/dist/css/bootstrap.css
vendored
@ -4886,29 +4886,34 @@ a.thumbnail.active {
|
|||||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
}
|
}
|
||||||
.media,
|
.media {
|
||||||
.media-body {
|
|
||||||
overflow: hidden;
|
|
||||||
zoom: 1;
|
|
||||||
}
|
|
||||||
.media,
|
|
||||||
.media .media {
|
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
.media .media-right,
|
||||||
|
.media .pull-right {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
.media .media-left,
|
||||||
|
.media .pull-left {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
.media:first-child {
|
.media:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
.media-object {
|
.media .media-left,
|
||||||
display: block;
|
.media .media-right,
|
||||||
|
.media .media-body {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.media .media-middle {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.media .media-bottom {
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
.media-heading {
|
.media-heading {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px 0;
|
||||||
}
|
|
||||||
.media > .pull-left {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.media > .pull-right {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
}
|
||||||
.media-list {
|
.media-list {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
@ -1,51 +1,44 @@
|
|||||||
// Media objects
|
.media {
|
||||||
// Source: http://stubbornella.org/content/?p=497
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Common styles
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Clear the floats
|
|
||||||
.media,
|
|
||||||
.media-body {
|
|
||||||
overflow: hidden;
|
|
||||||
zoom: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Proper spacing between instances of .media
|
// Proper spacing between instances of .media
|
||||||
.media,
|
|
||||||
.media .media {
|
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
|
|
||||||
|
// Proper spacing of .media-right
|
||||||
|
.media-right,
|
||||||
|
.pull-right {
|
||||||
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
.media:first-child {
|
|
||||||
|
// Proper spacing of .media-left
|
||||||
|
.media-left,
|
||||||
|
.pull-left {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For images and videos, set to block
|
.media-left,
|
||||||
.media-object {
|
.media-right,
|
||||||
display: block;
|
.media-body {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-middle {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-bottom {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset margins on headings for tighter default spacing
|
// Reset margins on headings for tighter default spacing
|
||||||
.media-heading {
|
.media-heading {
|
||||||
margin: 0 0 5px;
|
margin: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Media image alignment
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.media {
|
|
||||||
> .pull-left {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
> .pull-right {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Media list variation
|
// Media list variation
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user