Problem with Box Model Lesson

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-html-css/lessons/box-model/exercises/box-width-height?action=lesson_resume

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
The code instruction for this part of the exercise is:

1.In style.css, set the height of the content-header div to 320 pixels.

2.Next, set the width of the navigation div to 100%.

I believe I have done this, but when I run the program the lesson says I am in error and I cannot progress. Please help!

```

body {
background-image: url(“https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-6/htmlcss1-img_foodlogo.png”);
background-repeat: repeat;
overflow: hidden;
text-align: center;
}

.navigation {
background-color: rgba(255, 255, 255, 0.9);
height: auto;
text-align: center;
position: fixed;
left: 0;
top: 0;
z-index: 999;
width: 100%;
}

.navigation ul {
padding: 0;
}

.navigation li {
color: #666666;
display: inline-block;
font-family: ‘Roboto’, sans-serif;
font-size: 16px;
font-weight: 100;
letter-spacing: 2px;
margin: 20px;
text-transform: uppercase;
}

/** Right side styling **/

.content-box {
background: rgba(255, 255, 255, 0.9);
height: 500px;
margin: 0 auto;
position: relative;
top: 220px;
width: 80%;
}

.content-header {
background-image: url(“https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-6/htmlcss1-img_burgerphoto.jpeg”);
background-position: center;
background-size: cover;
position: relative;
top: -50px;
height: 320px;
}

.content-body {
margin: 0 auto;
width: 90%;
}

h1 {
background: #05A8AA;
color: #FFF;
font-family: ‘Oswald’, sans-serif;
font-size: 40px;
font-weight: 300;
line-height: 40px;
margin: 0 auto;
padding: 20px;
position: relative;
text-transform: uppercase;
top: 130px;
width: 70%;
}

h2 {
color: #FFF;
font-family: ‘Roboto’, sans-serif;
font-size: 26px;
font-weight: 700;
letter-spacing: 2px;
margin: 0;
text-transform: uppercase;
}

h3 {
color: rgba(255, 255, 255, 0.6);
font-family: ‘Roboto’, sans-serif;
font-size: 16px;
font-weight: 100;
letter-spacing: 2px;
margin: 0;
text-transform: uppercase;
}

p {
color: #333;
font-family: ‘Roboto’, sans-serif;
font-size: 18px;
font-weight: 100;
line-height: 34px;
}

.content-box ul {
padding: 40px 0px;
}

.content-box li {
background-color: #05A8AA;
display: inline-block;
list-style: none;
margin-bottom: 3px;
padding: 20px 40px;
width: 200px;
}

.btn {
color: #05A8AA;
border: 1px solid #05A8AA;
border-radius: 4px;
font-family: ‘Roboto’, sans-serif;
font-size: 18px;
font-weight: 700;
margin: 10px 0px;
padding: 20px;
text-decoration: none;
text-transform: uppercase;
}

.btn:hover {
background-color: #05A8AA;
border: 1px solid #05A8AA;
color: #FFF;
}

  • {
    border: 1px solid rgba(0, 0, 0, 0.3);
    }
<do not remove the three backticks above>

I had the same problem and then i put ; next to it and worked!

can you put an example of the code that you used that worked? From the sounds of it you just used an extra ; or something; both my height and width codes have colons already right? Thank you very much for your reply.

AA

Did you ever get an answer to this question? I am on the same thing right now myself?

No, I did not get an answer; but I managed to figure it out somehow.

It was always at the back of my mind that…while I was certainly adding the correct code, I must not have been adding it in the right place somehow.

So, to make sure the .content-header location in style.css was in fact the right one, I changed content-header in index.html to content-headerx. iI then changed the class in style.css to .content-headerx

That fixed it. aparently my width element was correctly placed. my index.html looked thus:

 <div class="content-headerx">
  <h1>BBQ Bacon Burger</h1>
</div>
<div class="content-body">

and my style.css looked thus:

.content-headerx {
background-image: url(“https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-6/htmlcss1-img_burgerphoto.jpeg”);
background-position: center;
background-size: cover;
position: relative;
top: -50px;
height: 320px;
}

I wasn’t expecting it to work, but it did.

4 Likes

I had the same problem-- although for some reason HTML file did not say “class= content-headerx”. However, when I switched BOTH html and css files to “content-headerx” I was able to progress.

hi

how did you do that

Thank you, bro!!! I tried the same and it worked!!! Thanks again!

THANK YOU!!!

I was out of my mind! This is such a simple task, and I was stuck with it for an hour.
I haven’t changed it to content-headerx, but simply to content.header instead of content-header.
I just wanted to know if ANY kind of change will affect the bug and it did.
Thanks again!

Cheers

Thanks bro,

changing to content-headerx worked for me too.

This is dumb. Your solution worked for me also. Thank you for posting. (I submitted a bug report.)

This worked for me too. What an annoying bug. Thank you for taking the time to post your findings bud!

1 Like

Im very glad this worked for people! Cheers guys!

AA

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.