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

I'm having a problem with CSS code I wrote. I set the margin to 0 for the header and I added an image to the header but in preview there's some gap on the right side of the picture. Can anyone help ???

header{
  margin: 0;
  padding: 0;
  height: 850px;
  width:100%;
}
<header>
  <img src="kan.jpeg"  />
</header>

1 Answer

Seyit

What element contains the header? You can use the developer tools and inspect the elements. The containing element must have a margin or padding set by default. Many of the elements have default styling.

Try

body {
   margin: 0;
   padding: 0;
}

Thanks !