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

contents of container floating outside the container

the contents of my section container are floating outside the container, they aren't in the container, what am i supposed to do ?

Hi Akhter,

Did you contain the desired content in a <div> tag in the HTML code? and target afterwards that specific tag with the CSS style? You for sure will need to put in place an id for that tag as well. Example:

<div id="floating_container">

CONTENT

<div>

in your style sheet you will need to target that ID with the following:

floating_elements {

PROPERTIES }

<header> <div> <h1> Akhter Rasool</h1> <h2> Student</h2> </div>

<nav> <ul id="headerlist"> <li class="selected"><a href="portfolio.html">Portfolio</a></li> <li ><a href="about.html">About</a></li> <li ><a href="contact.html">Contact</a></li>

</ul> </nav> </header>

but the list items float outside the header section, unless i increase the size of the header section... what am i doing ?

2 Answers

It might be a good idea to clear the element so that they will not get interleaved. Please see the following reference and see how the clear works: http://learn.shayhowe.com/html-css/positioning-content/

Thank you, Adrian