Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialruna verse
409 PointsHow do you crop portrait images so that they are responsive and the same h&w as landscape images?
I am trying to resize an image on the bottom right of this website [https://codepen.io/runaverse/full/dzqKLp] to be the same size as the landscape photos. I've done it by using this particular set of code, but the sizing gets wonky when you resize the browser. Any tips? :S
<div class="col-md-6 ">
<div class="bake-img">
<img class="portfolio-img img-fluid bake-img-2" src="http://res.cloudinary.com/ottiya/image/upload/c_scale,w_985/v1504150918/brooke-lark-261287_rbw0mw.jpg" alt="yummy pastries">
</div>
<h4 class="portfolio-title">Bake920</h4><p class="portfolio-text">Alcatra kielbasa t-bone tongue, swine turducken boudin pancetta kevin leberkas. Bacon ipsum dolor amet brisket corned beef sirloin tongue ribeye venison. </p>
</div>
.bake-img {
max-height: 273px;
overflow: hidden;
margin: 20px 0 20px 0;
}
.bake-img-2 {
margin-top: -100px;
}
2 Answers
Samandar Mirzayev
11,834 PointsTry to Put by percentage. It might be help. If u used bootstrap there is some tips u can do for example in class : mt-5 this means from margin top will take out. It might a bit different by version . I have types for bootstrap v 4 alpha 6
Samandar Mirzayev
11,834 PointsU can use for image as well image-fluid have a look getbootstrap.com