5
As shown in the image below, I can make the picture rectangular turn round, but it gets distorted:
.posts .posts-item img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
margin-bottom: 0.5rem;
background-position: center center;
}
.posts.round .round-container img {
width: auto;
height: 100%;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
figure img {
border-radius: 100%;
width: 12rem;
height: 12rem;
}
<a href="" class="posts-item">
<div class="title">Conheça a lista dos melhores cafés</div>
<figure>
<div class="round-container"><img src="http://vidafit.com.br/wp-content/uploads/2014/11/cafe-coracao-776x517.jpg" alt=""></div>
<figcaption>Lorem ipsum dolor sit amet, onsectetur dispiscing</figcaption>
</figure>
</a>
Does anyone know how to solve this for any image I put?
See if it helps you: http://codepen.io/anon/pen/jrBqAp
– Diego Souza
It would be like this, but the image would have to be of a specific size and for me it doesn’t fit yet (as this is big, just appeared the spoon in the circle).
– Bianca Pereira