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 CSS Layout Basics Page Layout with the Float Property Footer Layout with Floats

Alexandre Gomes
Alexandre Gomes
4,775 Points

use .cf instead of .clearfix ?

Hello,

Is there a possibility for you to give Treehouse students the possibility to modify the .clearfix selector to ".cf" in the CSS if they want to, and to give the footer the class name "cf" instead of "clearfix" in the HTML if they want?

You specified in the course that developers use clearfix or sometimes cf as the class name, for it to be more concise. Also, in the article you included in Teacher's notes ("A new micro clearfix hack" by Nicolas Gallagher, he uses cf as the class name.

I guess it could be great to let the students chose whatever class they want!

Thanks :)

style.css
/* Complete the challenge by writing CSS below */



.clearfix::after {
  content: "";
  display: table;
  clear: both;
}


.footer-nav {float: left;}
.footer-nav li {float:left;}

.logo {float: right;}
index.html
<!DOCTYPE html>
<html>
<head>
    <title>Getting Started with CSS Layout</title>
    <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
    <body>
    <div class="container">
        <footer class="clearfix">
            <img class="logo" src="city-logo.svg" alt="logo">
            <ul class="footer-nav">
                <li><a href="#">Ice cream</a></li>
                <li><a href="#">Donuts</a></li>
                <li><a href="#">Tea</a></li>
                <li><a href="#">Coffee</a></li>
            </ul>
            <p class="copyright">&copy;2015 The Best City.</p>
        </footer>
    </div>
    </body>
</html>

1 Answer

Hello Alexandre, you can call the .clearfix class anything you want as long as that class is attached to the div or element you want it to be attached to. So yes you can use .cf as long as that same class is in the HTML. Please let me know if you have any questions. Hope this helps!

Alexandre Gomes
Alexandre Gomes
4,775 Points

Unfortunately, if you don't use the class "clearfix" in the test, the answer pass as wrong, even though it would work exactly the same (and even be more clear and concise) in normal project conditions.

So I am asking the team if they could allow that answer to be recognized in the test