matth921104 Posted May 7, 2022 Share Posted May 7, 2022 Hi there everyone. I'm making a tribute page for my favorite band as a project to get some practice. Wasn't sure where to post this because it's CSS and HTML. I've attached an image so you can see what the problem is. I can't seem to get the images to fit the container. I've tried a bunch of things and I can't get it right. Thanks for your help. Here is my CSS code: /*Band member images*/ .row { display: flex; max-width: 300px; } .column { flex: 25%; padding: 1px; } .figure { border: 1px solid black; max-width: 300px; max-height: 300px; } .img { max-width: 300px; max-height: 300px; object-fit: cover; } HTML code: <figure class="row"> <figure class="figure"> <img class="img" src="WebDesign_HTML_practice_TheKillersTributePage_pictures/brandon_flowers.jpg" alt="Brandon Flowers"><figcaption>Brandon Flowers</figcaption> </figure> <figure class="figure"> <img class="img" src="WebDesign_HTML_practice_TheKillersTributePage_pictures/mark_stoermer.jpg" alt="Mark Stoermer"><figcaption>Mark Stoermer</figcaption> </figure> <figure class="figure"> <img class="img" src="WebDesign_HTML_practice_TheKillersTributePage_pictures/dave_keuning.jpg" alt="Dave Keuning"/><figcaption>Dave Keuning</figcaption> </figure> <figure class="figure"> <img class="img" id="ronnievannucci" src="WebDesign_HTML_practice_TheKillersTributePage_pictures/ronnie_vannucci.jpg" alt="Ronnie Vannucci"><figcatpion>Ronnie Vannucci</figcatpion> </figure> </figure> Link to comment Share on other sites More sharing options...
dsonesuk Posted May 7, 2022 Share Posted May 7, 2022 (edited) You not providing sizes for it to grow to, just dont grow above 300px, so ok! I'll stay at this size then job done! Remove max-height and max-width and try it with width and height at 100%. Also 'figcatpion' that's a new one on me? Edited May 7, 2022 by dsonesuk Link to comment Share on other sites More sharing options...
matth921104 Posted May 8, 2022 Author Share Posted May 8, 2022 Thanks for your help @dsonesuk Great, I will give it a go. Hahaha, didn't see that. Will make that change too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now