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

Maria Cuan
Maria Cuan
4,500 Points

Boostrap Prototype feedback ?

Hello Treehouse members! I hope everyone is doing great this monday! I started a simple bootstrap prototype. Everything is doing awesome except that my navbar (wrapped in my container div) seems to be longer than my content that is placed on a grid. Any ideas why this is happening?

thank you ! :)

James Barnett
James Barnett
39,199 Points

Show us your code, put it up on codepen.

Maria Cuan
Maria Cuan
4,500 Points

http://codepen.io/anon/pen/wFDrA

I hope I did this right :) I didn't include the css because that is Bootstrap's.

Thanks!

7 Answers

James Barnett
James Barnett
39,199 Points

Maria Cuan -

Since text is left aligned by default, to see where the div actually stops and how it affects the look of your layout add in .col-md-3 { outline: solid; }.

To have those divs align the text in the center thus reduce the gap, you can throw on the bootstrap class text-center on the div that has the row class or if you don't want all the text in that div to be centered, you can add that class to each of those h1s.

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi there Maria.

Without seeing your HTML it is difficult to say, maybe your container needs to start within the nav?

For example:

<nav class="navbar">
     <div class="container">
     </div>
</nav>

Rather than this:

<div class="container">
    <nav class="navbar">
    </nav>
</div>

Hope this helps

Maria Cuan
Maria Cuan
4,500 Points

I dont want to paste the whole thing so here is the pen:

http://codepen.io/anon/pen/wFDrA

Anthony Hind
Anthony Hind
5,715 Points

If you paste your HTML into the Direct input tab Here you will see you have quite a few errors with your code.

James Barnett
James Barnett
39,199 Points

Actually it's just 1 error, line 75, Maria Cuan typo'ed the closing tag of the a element as </href> instead of </a> fix that one mistake and the markup validates.

Anthony Hind
Anthony Hind
5,715 Points

Hi James, Didn't want to give the game away correcting the code for Maria Cuan when you have the one error it can then affect the code right through the markup as you know.

Hope you got sorted Maria, James Barnett is the man for helping people out!!!

Cheers

James Barnett
James Barnett
39,199 Points

Anthony Hind -

I see where you are going with it, definitely directing people to a validator so they can see how one error can affect the rest of a document, I'm on the same page now.

Maria Cuan
Maria Cuan
4,500 Points

I have now validated my code :) and added the bootstrap css on code pen! I need to look into code pen more :) that is awesome!

I still have that weird space. I wrapped my navbar on a container div and did the same to my grid elements.

http://codepen.io/anon/pen/wFDrA

Thank you all for your feedback, this helps me a lot !

James Barnett
James Barnett
39,199 Points

I took a look at the updated pen, I'm probably just being dense here, but I'm not seeing the issue.

Can you upload a screenshot with an annotation of the issues you are seeing.

Maria Cuan
Maria Cuan
4,500 Points

Oh! sure!

https://www.dropbox.com/s/t16pnrn9uoa7fmw/Esther_Cuan.jpg

Maybe Im having an alignment problem with my grid.

Maria Cuan
Maria Cuan
4,500 Points

Oh wow.
I can see now! Thank you so much! Now I also learned to outline divs in order to see what is going on hahaha Thank you !

James Barnett
James Barnett
39,199 Points

Yeah outline is a better choice than border because outlines don't take up space in the box model so they don't affect your layout.