# Side-by-side image using a bootstrap grid

**URL:** <https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470>\
**Category:** General\
**Created:** [April 2, 2017, 11:50pm UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470 "2017-04-02T23:50:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stacyrch2010](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@stacyrch2010](https://forum.freecodecamp.org/u/stacyrch2010)\
**Post date:** [April 2, 2017, 11:50pm UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/1 "2017-04-02T23:50:00Z")

</div>

Hi. I’m having a lot of trouble getting my images to align side by side using bootstrap. I’m obviously doing something wrong, but I don’t know what it is. Thanks in advance. Note that I had to delete the source code for the last two images. As a newbie, I’m allowed to post only one image here. The “col” div classes would have the image class and source code between them. I hope this makes sense.

.silver-background {  
background-color: silver;  
}

.text {  
text-align: left;  
font-family: Arial;  
font-size: 18px;  
color: black;  
}

.headline {  
text-align: left;  
font-family: Arial;  
font-size: 24px;  
color: black;  
}

.headline2 {  
text-align: left;  
font-family: Arial;  
font-size: 24px;  
font-style: bold;  
color: black;  
}

.portfolio-image {  
height: 200px;  
width: 200px;  
}

## Web developer - Writer - UX designer - Artist

Front-end developer, writer, UX designer and artist with experience in project and CMS management

### Portfolio

 ![](https://global.discourse-cdn.com/freecodecamp/original/3X/9/9/995b4e350f659cb8023dcdcf83926ef1764d3768.jpg)

---

<div class="post-metadata">

**Author:** ![owel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/owel/32/48425_2.png) [@owel](https://forum.freecodecamp.org/u/owel)\
**Post date:** [April 3, 2017, 12:04am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/2 "2017-04-03T00:04:09Z")

</div>

Do you have a codepen for this so we can see the actual problem?

One can use a container and row div, then use individual div containers for the images. There are 12 divisions in a row in Bootstrap and as long as the total width of your divs total 12 or under, they will all appear side-by-side. Now, let’s say you assign each div a width of 3, then you can put 4 images side by side on each row. (i.e. 12 / 3 = 4) If make each div a width of 2, then you can put 6 images side by side per row.

---

<div class="post-metadata">

**Author:** ![stacyrch2010](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@stacyrch2010](https://forum.freecodecamp.org/u/stacyrch2010)\
**Post date:** [April 3, 2017, 12:05am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/3 "2017-04-03T00:05:12Z")

</div>

Here’s the link: [https://codepen.io/stacyrch2010/pen/ZeJMLp](https://codepen.io/stacyrch2010/pen/ZeJMLp)

Thanks!

---

<div class="post-metadata">

**Author:** ![owel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/owel/32/48425_2.png) [@owel](https://forum.freecodecamp.org/u/owel)\
**Post date:** [April 3, 2017, 12:08am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/4 "2017-04-03T00:08:16Z")

</div>

ahhh, it looks like you didn’t add the Bootstrap framework in your codepen code.

Go to Settings \> CSS \> Quick Add \> Bootstrap

Then proceed from there…

---

<div class="post-metadata">

**Author:** ![owel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/owel/32/48425_2.png) [@owel](https://forum.freecodecamp.org/u/owel)\
**Post date:** [April 3, 2017, 12:10am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/5 "2017-04-03T00:10:26Z")

</div>

And I would use “col-sm-4” since “xs” refers to an extra-small mobile screen. For a phone view, you’d normally want the image to occupy the full width of the phone screen. col-xs-4 will be a really small image.

---

<div class="post-metadata">

**Author:** ![stacyrch2010](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@stacyrch2010](https://forum.freecodecamp.org/u/stacyrch2010)\
**Post date:** [April 3, 2017, 12:11am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/6 "2017-04-03T00:11:51Z")

</div>

> [@owel](#):
>
> Go to Settings \> CSS \> Quick Add \> Bootstrap

Thank you! OMG, thank you. This has been driving me crazy for days. It’s a relief to know it’s not entirely my code. I’ll change the image size to small. Thanks again. Your suggestions totally fixed the issue.

---

<div class="post-metadata">

**Author:** ![owel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/owel/32/48425_2.png) [@owel](https://forum.freecodecamp.org/u/owel)\
**Post date:** [April 3, 2017, 12:16am UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/7 "2017-04-03T00:16:02Z")

</div>

Yeah, in the FCC exercises, they add the necessary Bootstrap code for you behind the scenes.  
See this lesson "Use Responsive Design with Bootstrap Fluid Containers"  
but in codepen, you’d have to add it explicitly.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 5:51pm UTC](https://forum.freecodecamp.org/t/side-by-side-image-using-a-bootstrap-grid/102470/9 "2021-01-16T17:51:38Z")

</div>

Closed on January 16, 2021, 5:51pm UTC


