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 trialprasannakulkarni2
14,918 PointsMaking 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
Adam Frangione
1,912 PointsMake 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>
Wayne Priestley
19,579 PointsHey 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.
Nijad Kifayeh
6,092 Pointsin 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
prasannakulkarni2
14,918 PointsThank 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/
prasannakulkarni2
14,918 Pointsprasannakulkarni2
14,918 PointsThanks a lot Adam Frangione . It did work. Appreciate your response.