CSS CSS Layout CSS Media Queries Media Queries

Becca thorley
Becca thorley
1,342 Points

Create a media query... inside the media query select the header element

unsure as to why I'm receiving the correction of "Did you specify the correct background color?" When giving this answer

@media screen and (min-width: 421px){
  header {
    background-color: #294969;
    text-color: ghostwhite;
<!DOCTYPE html>
<html lang="en">
  <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">
    <div id="logo">Developer Diane’s Blog</div>
    <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 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>
    <footer>©2020 Developer Diane.</footer>
Becca thorley
Becca thorley
1,342 Points

This is the full task question... Create a media query that targets all devices when the viewport width is 421px or wider. Inside the media query, select the header element. Set the background color to #294969 and the text color to ghostwhite.

1 Answer

Brandon White
.a{fill-rule:evenodd;}techdegree seal-36
Brandon White
Treehouse Moderator

Hi Becca,

In the code you've posted you're attempting to assign the value of ghostwhite to the property text-color, but text-color is not a valid property in CSS. The property you're thinking of/attempting to use is color (not text-color). Change that and make sure you have a closing brace to match your opening brace on your @media rule, and you should be good to go.

In your question you quote the error message as being "Did you specify the correct background color?" Are you sure that's what the message was, because the background-color is fine, is the text-color that wouldn't be evaluated correctly.

Becca thorley
Becca thorley
1,342 Points

Thank you so much! I knew it was going to be something really obvious!