Es gibt einige zusätzlichen Platz auf der rechten Seite in meiner Galerie ...css horizontale Mittel Bilder ohne Verwendung von% Prozent
Meine Bilder Container:
.my-gallery figure {
display: block;
float: left;
width: 150px;
}
Ist es möglich, Bilder machen immer horizontales Zentrum in unterschiedlich großen Bildschirm ohne mit % percent value
? Oder hat jemand eine geniale Idee, die extra Raum nicht so komisch macht?
Oder % percent value
Trick ist der einzige Weg?
In Bildschirm A:
In Bildschirm B:
.my-gallery {
width: 100%;
float: left;
}
.my-gallery img {
width: 100%;
height: 112px;
}
.my-gallery figure {
display: block;
float: left;
margin: 0 5px 5px 0;
width: 150px;
}
.my-gallery figcaption {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
min-height: 26px;
}
.my-gallery img {
max-width: 100%;
}
<div class="my-gallery">
<figure>
<a href="big1.jpg">
<img src="http://placehold.it/112x150" alt="1" />
</a>
<figcaption>111111111111111111111111</figcaption>
</figure>
<figure>
<a href="big2.jpg">
<img src="http://placehold.it/112x150" alt="2" />
</a>
<figcaption>222222222222222222222222</figcaption>
</figure>
<figure>
<a href="big3.jpg">
<img src="http://placehold.it/112x150" alt="3" />
</a>
<figcaption>3333333333333333333333333333333</figcaption>
</figure>
<figure>
<a href="big4.jpg">
<img src="http://placehold.it/112x150" alt="4" />
</a>
<figcaption>444444444444444444444444</figcaption>
</figure>
...
</div>
Was ist das Problem der Prozentsatz mit? – tocqueville