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 trial

HTML

Melissa Benton
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Melissa Benton
Front End Web Development Techdegree Graduate 17,805 Points

I made a grid in Bootstrap but the columns are aligning vertically, not horizontally, how do I fix this issue?

My code looks like this:

<div class="container"><!--images container-->
          <figure class="row justify-content-center">
            <img class="skillsIamge col-md-2" src="" alt="Image of HTML icon."/><!--HTML-->
            <figcaption></figcaption>

            <img class="skillsIamge col-md-2" src="" alt="Image of CSS icon."/><!--CSS-->
            <figcaption></figcaption>

            <img class="skillsImage col-md-2" src="" alt="Image of Sass icon."/><!--Sass-->
            <figcaption></figcaption>

            <img class="skillsImage col-md-2" src="" alt="Image of JavaScript icon."/><!--JS-->
            <figcaption></figcaption>

            <img class="skillsImage col-md-2" src="" alt="Image of inDesign icon."/><!--InDesign-->
            <figcaption></figcaption>
          </figure>
        </div>

1 Answer

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

Hi Melissa Benton have you tried wrapping div elements around each set of img and figcaption elements and adding the col-md-2 class to those div elements instead? Also, the general HTML markup is not completely valid with the current code and suggestion. I generally recommend that you take a new look at structuring your HTML around the grid layout example for bootstrap. I can't advise since I don't know what it is you are trying to build for the end goal!

Having said that, It would be beneficial to see the whole scope of your code to debug further, as it's generally hard to identify if there is anything else related to the code (e.g. CSS) that we can't see in this small snippet you've shared. I would recommend sharing a workspace or a codepen link if it's too big of scope, otherwise a couple of formatted snippets for the html and css respectively.

Melissa Benton
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Melissa Benton
Front End Web Development Techdegree Graduate 17,805 Points

Thank you Jamie, your answer is helpful. The figcaption tags were throwing off the grid layout. I deleted them because I didn’t really need them and the img elements align horizontally as desired.