I'm not sure how to deal with the following problem.
I was trying to work with <li class="filme">
, with its responsive size, however as each image has a variable size. When it arrives at a certain size the images begin to break the layout. If I set the images size, my <li class="filme">
to start growing more than the image. For% w / o% is in% and pixel image. If I set the <li>
of the li to auto (to occupy the image size) my layout as it grows gets a blank space in the layout.
HTML:
<main class="principal">
<section class="section-filmes">
<ul id="lista-filmes" class="lista-filmes">
<!-- Lista de filmes aqui..-->
<li class="filme"> <img src="img-filme"> </li>
</ul>
</section>
</main>
CSS:
img{ max-width 100% }
.lista-filmes::after{
content: '';
display: block;
clear: both;
}
.lista-filmes .filme{
width: 100%;
display: block;
float: left;
background: #fff;
padding: 1rem;
margin-bottom: 1rem;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
}
Note: Movie images are variable sizes, example 400x600 300x450 800x900 and etc.
I would like to know if you have any solution to make the images responsive, without breaking the layout.
The idea is that in the end look like this: click here to see
But responsive.