mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 01:24:19 +02:00
Overall responsive img
styles
`img`s are no longer responsive by default. Instead, use `.img-responsive` as a class or mixin. Existing `.thumbnail > img` and `.img-thumbnail` classes now make use of this as a mixin as well.
This commit is contained in:
15
docs/assets/css/bootstrap.css
vendored
15
docs/assets/css/bootstrap.css
vendored
@@ -325,9 +325,13 @@ a:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-responsive {
|
||||||
|
display: block;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-rounded {
|
.img-rounded {
|
||||||
@@ -3958,6 +3962,13 @@ button.close {
|
|||||||
transition: all 0.2s ease-in-out;
|
transition: all 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.thumbnail > img,
|
||||||
|
.img-thumbnail {
|
||||||
|
display: block;
|
||||||
|
height: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -3972,8 +3983,6 @@ a.thumbnail:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.thumbnail > img {
|
.thumbnail > img {
|
||||||
display: block;
|
|
||||||
max-width: 100%;
|
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
@@ -59,12 +59,14 @@ a:focus {
|
|||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
img {
|
img {
|
||||||
// Responsive images (ensure images don't scale beyond their parents)
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Responsive images (ensure images don't scale beyond their parents)
|
||||||
|
.img-responsive {
|
||||||
|
display: block;
|
||||||
max-width: 100%; // Part 1: Set a maximum relative to the parent
|
max-width: 100%; // Part 1: Set a maximum relative to the parent
|
||||||
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
|
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
|
||||||
|
|
||||||
// Match vertical alignment with other comment elements
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rounded corners
|
// Rounded corners
|
||||||
|
@@ -17,6 +17,10 @@
|
|||||||
border-radius: @thumbnail-border-radius;
|
border-radius: @thumbnail-border-radius;
|
||||||
.transition(all .2s ease-in-out);
|
.transition(all .2s ease-in-out);
|
||||||
}
|
}
|
||||||
|
.thumbnail > img,
|
||||||
|
.img-thumbnail {
|
||||||
|
.img-responsive();
|
||||||
|
}
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -32,8 +36,6 @@ a.thumbnail:focus {
|
|||||||
|
|
||||||
// Images and captions
|
// Images and captions
|
||||||
.thumbnail > img {
|
.thumbnail > img {
|
||||||
display: block;
|
|
||||||
max-width: 100%;
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user