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 CSS Doesn't remove the white space at the top of my web page. Help? :(

I've done exactly what Nick told me and it's not worked I'm not sure if i've missed something i've tried moving things around it's doing nothing.

https://w.trhou.se/i4wckuzdxy my workspace

if anyone knows please explain to me what I did wrong?

Thanks,

Louis

8 Answers

Hi Louis,

I found the problem it's a simple syntax error. Take a look at your css and under the "HEADING" section go down to the "header" property you have and look at the name. You have a double colon after "header*(:)*" Just remove the double colon and your white space problem will be fixed.

/**************
HEADING
***************/

header: {
  float: left;
  margin: 0 0 30px 0;
  padding: 5px 0 0 0;
  width: 100%;

}
/**************
HEADING
***************/

header {
  float: left;
  margin: 0 0 30px 0;
  padding: 5px 0 0 0;
  width: 100%;

}

I'm actually embarrassed at how simple that was to fix!

Thank you so much!

Louis

Not a problem, happy to help out!

Also don't be embarrassed, it's very common when it comes to coding. In fact I would say 85% of the time when we run into problems with our code is because of a syntax error. At least that's my experience anyways.

You may want to try closing and re-opening workspaces. Or alternatively not using workspaces at all. It causes a ton of issues because at times, it can take half an hour or more to make simple changes to your port.

Good luck and let me know if waiting / re-opening workspaces worked !

Done that twice and cleaned the browser history and cache.

Done that twice and cleaned the browser history and cache.

I would download your workspaces, make a folder, copy the files from the project folder to the new one and upload it to an editor such as Atom by Github.

It might solve your problem, but regardless, will save you from recurring problems in the future.

It seems weird, but I have heard sometimes the body element has some margin, so in your css write as follows:

body{ margin: 0; }

Tell me if it worked

He has normalize.css so he shouldn't need to do that.

You are right, I already know that but It could be the problem. That was my case

Hi Mario

Didn't work

Thanks for replying

Louis

Hi Mario

Didn't work

Thanks for replying

Louis

Something unrelated, I am unsure if it will cause problems; I noticed that for all of your pictures you put

< img src="/img/....." alt"">

You only need

< img src="img/....." alt"">

In any case, I don't know if that might cause issues.

I think you have a collapsing margin issue. Check your H1 at the top (the one with your name), if you take the margin off of it the issue goes away. You could make the <header> overflow: hidden or remove the margin from the top of the h1 and use padding on the header as well.

http://www.w3.org/TR/CSS2/box.html#collapsing-margins