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

CSS Framework Basics Prototyping with Bootstrap Working with Nested Grids and Responsive Images

Making a single page website, with images stacked on top of each other using bootstrap. Problem with images

All the subsquent images seem to be moving to the right. What could be the problem? Am I doing something wrong with the div?

Here is the sample of the code:

<div class="row"> <div class="col-lg-6 col-sm-offset-2"> <img src="img/NYC.JPG" alt="View from Brooklyn Bridge" style="width:800px;height:700px"> <div class = "row"> <div class="col-lg-10 col-sm-offset-2"> <p> This is NYC</p> </div>

<div class="row">
  <div class="col-lg-6 col-sm-offset-2">
  <img src="img/NYC1.JPG" alt="View from Brooklyn Bridge" style="width:800px;height:700px">
  <div class = "row">
  <div class="col-lg-10 col-sm-offset-2">
  <p> This is NYC</p>
</div>

<div class="row">
  <div class="col-lg-6 col-sm-offset-2">
  <img src="img/NYC2.JPG" alt="View from Brooklyn Bridge" style="width:800px;height:700px">
  <div class = "row">
  <div class="col-lg-10 col-sm-offset-2">
  <p> This is NYC</p>
</div>

4 Answers

Make sure you are closing your div tags </div> .... looks like you have a lot left open... so for example

<div class="row">
     <div class="col-lg-6 col-sm-offset-2">
          <img src="img/NYC1.JPG" alt="View from Brooklyn Bridge" style="width:800px;height:700px">
     </div>
     <div class = "row">
          <div class="col-lg-10 col-sm-offset-2"></div>
          <p> This is NYC</p>
     </div>
</div>

Thanks a lot Adam Frangione . It did work. Appreciate your response.

Wayne Priestley
Wayne Priestley
19,579 Points

Hey Prasanna,

I see you have an error with div class row.

<div class = "row">

Remove the space between class and = and " and see if that helps.

Hope this helps.

in addition to the above, you are using col-sm-offset-2 which will move the whole div (including the image it contains) to the right

Thank you everyone for your help. With the help I received from this page I was finally able to make the website live.

It is a basic website made using bootstrap. You can check it here: http://nyc.eclecticderivatives.com/