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
brandonlind2
7,823 PointsWhy cant I remove the margin from my h1 one tag main-header-title in the header?
If I give it a margin of 0 in the stylesheet its just ignore and it still has a margin of 54.297. I noticed that if I set it to display inline, it still has margin just not as much????
<h1 class="main-header-title"> Store</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="clothes.html">Clothes</a></li>
</ul>
</nav>
</header>
.main-header-title {
margin: 0;
font-size: 3em;
}
3 Answers
Jennifer Nordell
Treehouse Teacher@media screen and (min-width: 600px){
.main-header-title {
text-align: left;
margin: 5% 10%;
font-size:
}
This is overwriting your clear, I think :)
Steve Hunter
57,712 PointsGood shout.
brandonlind2
7,823 Pointsthanks lol
Jennifer Nordell
Treehouse TeacherIs it possibly a browser default margin? Do you have normalise.css loaded into the html?
Steve Hunter
57,712 PointsYour h1 is inside the header element, I think. Is there something styling the header element that overrides the h1?
Steve.
Jennifer Nordell
Treehouse TeacherSteve Hunter I agree. Something is writing over it. I don't know whether or not it's the h1 element that has a style on it or if it's a browser default because normalise.css isn't loaded. I think we're going to need to see all the code. And good point.... it is inside a header element. So there could be something there as well.
Steve Hunter
57,712 PointsI agree with you completely!!
brandonlind2
7,823 PointsI don't think so, wouldnt css on a h1 tag that is inside a header override the header, since its more specific? header { background-color: lightgrey; text-align: center; margin: auto; max-width: 100%; }
Steve Hunter
57,712 PointsSomething's doing it, so let's explore everything. Have you normalized the page, as Jennifer suggested?
Can we see the code in full - is it in GitHub?
Steve Hunter
57,712 PointsTry commenting out the margin: auto; line in the header selector - see what that does.
brandonlind2
7,823 Pointsbrandonlind2
7,823 Pointsupdate I added normalize but still not working