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
Sayfuddin Achmad
4,813 Pointsfloat layout
hii everyone , there are know this challenge , i can't do this task ,,,, .huhuhu ,,,,:( Let's start by floating main-logo and the main-nav list items left. / Complete the challenge by writing CSS below / ''' / Float Styles ================================ */
/* Float Clearfix ================================ */
.group:after { content: " "; display: table; clear: both; } '''
6 Answers
Jacob Miller
12,466 PointsThis code is the clearfix:
.group:after {
content: " ";
display: table;
clear: both;
}
So all you need to do to add the clearfix to the header element is go into the html file, and add the class "group" to the main-header element, like the code below. You can add as many classes as you like to an element by separating them with a space.
<header class="main-header group">
hani munshi
3,801 Points<div class="extra col"> <h3>Extra Content</h3> <p>Filet mignon turkey flank doner strip steak. Frankfurter ham hock turkey, venison sirloin pig chuck shank capicola hamburger doner spare ribs boudin.</p> </div>
Jacob Miller
12,466 PointsSelect the logo and nav list items in css using their class names, and add the property float: left; See the code below:
.main-logo, .main-nav li {
float: left;
}
Jacob Miller
12,466 PointsIn the same way that you added the "group" class to the <header>, add the class "col" the the div with the class "extra" in the html file. Then add an opening and closing h3 tag inside that div, as well as an opening and closing p tag. If you're really not understanding the code challenges, I would recommend going back and watching the video again.
Sayfuddin Achmad
4,813 Pointshehe ,,, ok jacob thanks so much for you'r help ,,,, :D
Jacob Miller
12,466 PointsNo problem. :)
Sayfuddin Achmad
4,813 PointsHow about this Jacob It looks like we need a clearfix in the header. Give the main-header element the class we created for clearing floats. "' /* Float Styles ================================ / .main-logo, .main-nav li { float: left; } / Float Clearfix ================================ */ .group:after { content: " "; display: table; clear: both; } "'
Sayfuddin Achmad
4,813 Pointsand next