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 trialGreggar Deterville
12,263 Pointsgive the header a solid, orange bottom border that's 10px wide."
for some reason nothing seems to work.
/* Complete the challenge by writing CSS below */
header {
Background-color: blue;
color: ghostwhite;
padding-top: 20px;
padding-bottom: 25px;
border: 10px solid orange;
border-bottom-color: orange;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Developer Diane's blog</title>
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<div id="logo">Developer Diane’s Blog</div>
</header>
<article>
<section class="intro">
<h1>The verdict is in. CSS Layout is great!</h1>
<p>I’ve been working with CSS for a while now, and I have to say, it’s pretty awesome. I love being able to separate content from presentation, and to keep all my styles in an external stylesheet.</p>
<p>I’ve had a pretty good grasp on the basics for a while now, but I needed to learn more about how to control layout with my CSS. Understanding CSS layout meant first exploring the parts of the CSS box model.</p>
</section>
<section class="featured">
<h2>The CSS Box Model</h2>
<p>There are lots of great resources online to help you learn the CSS Box Model. I like the CSS Tricks article <a href="https://css-tricks.com/the-css-box-model/" target="_blank">The CSS Box Model</a> by Chris Coyier. To quote the author:</p>
<blockquote>At the risk of over-repeating myself: <strong>every element in web design is a rectangular box.</strong></blockquote>
<p>That’s right! Every HTML element is considered by the browser to be a rectangular box.</p>
<p>The CSS Box Model consists of four properties: content, padding, border, and margin. I've included a graphic from Coyier’s article to illustrate this principle.</p>
<p class="clear">It’s pretty easy to understand the Content portion of the box model. The content is whatever your HTML consists of. It could be a paragraph full of text, or a bulleted list, or an image.</p>
<p>Beginning developers may have some trouble keeping the other parts of the box model straight, so let’s examine them one by one.</p>
</section>
<footer>©2020 Developer Diane.</footer>
</body>
</html>
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 Pointshenrycs: Great job in reaching out and helping your peers! Posting your response as an answer is not just for moderators, please feel free to post your solutions as answers. If you have a question or need further explanation from the poster to help solve the issue that's when it's a great idea to use comments! Keep it up, helping others is a great way to reinforce your own knowledge as well :)
1 Answer
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsHello Greggar!
henrycs stated how to keep your code DRY and guided you to the correct solution for this challenge! It's important to point out that in this step of the challenge there should only be a bottom border. Using the border:
declaration will always add your styles around the whole element. That is the specific reason as to why your code wasn't working for this challenge.
While technically incorrect because you don't want unnecessary code, if you would've originally put:
header {
...
border-bottom: 10px solid orange;
border-bottom-color: orange;
}
You would have passed this step and moved on to the next because you were only declaring a style for the bottom border.
Hope this helps!
Henry Crompton-Smith
Full Stack JavaScript Techdegree Student 5,815 PointsHenry Crompton-Smith
Full Stack JavaScript Techdegree Student 5,815 PointsHey!
New student just started here and taking a wander :)
You can consolidate both of your border properties into one line, like this:
border-bottom: 10px solid orange;
which means you could then remove the following and it should work!
Your code works, but you are essentially setting the color of the border-bottom to the same color (orange) as the rest of the border, which was set in your first property.
I hope that helps!