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

My footer color disapeared...

My footer color disappeared and out of nowhere and I don't know why...

----------------------------------------------{CSS}----------------------------------------------------------

<!-- HEADER STARTS HERE --> body { margin: 0; background: #222; font-family: 'Work Sans', sans-serif; font-weight: 650; }

.container { width: 80%; margin: 0 auto; }

header { background: #55d6aa; height: 92px; font-size: 32px; }

header::after { content: ''; display: table; clear: both; }

.logo { float: left; height: 65px; width: 16%; margin: 10px; }

nav { float: right; }

nav ul { margin: 0; padding: 0; list-style: none; }

nav li { display: inline-block; margin-left: 70px; padding-top: 23px;

position: relative; }

nav a { color: #444; text-decoration: none; text-transform: uppercase; font-size: 14px; }

nav a:hover { color: #000; }

nav a::before { content: ''; display: block; height: 5px; background-color: #444;

position: absolute; top: 0; width: 0%;

transition: all ease-in-out 250ms; }

nav a:hover::before { width: 100%; }

<!-- MAIN STARTS HERE --> main {}

<!-- FOOTER STARTS HERE --> footer { background-color: #55d6aa; width }

.github { height: 50px; width: 3%; padding-left: 35px; }

.instagram { height: 50px; width: 3%; padding-left: 20px; }

.bttf a { text-decoration: none; color: #444;

position: relative; }

.bttf a:hover { color: #000; }

.bttf a::before { content: ''; display: block; height: 5px; background-color: #444;

position: absolute; top: 18px; width: 0%;

transition: all ease-in-out 250ms; }

.bttf a:hover::before { width: 100%; }

.footertext { float: right; padding-right: 700px; margin-top: 0px; line-height: 1; }


2 Answers

Steven Parker
Steven Parker
243,318 Points

Did the problem start when you added the comments? Those are HTML-style comments, not CSS-style:

<!-- This is an HTML comment, not valid in CSS -->
/* This is a valid CSS comment */

But if that's not it, to facilitate a complete analysis it's important to show all the code (including the HTML part), and with proper formatting. An easy way to do this is to make a snapshot of your workspace and post the link to it here.

If you aren't using workspaces, you can paste in your modules, but be sure to format them. Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

Yes, this fixed my problem. I can't believe that I was staring at the screen dumbfounded for 2 hours! Thank you so much.

Is it maybe because you haven't defined a width for the footer? You just have width } Also have you tried checking the code in something like http://csslint.net/ ?