Ben McKay
Ben McKay

Reputation: 1

My Header Div is not working

My header doesn't work, as in when I give it a

background: #XXXXXX

it doesn't fill the whole header just 2 sides and when I add a width of say 90% and margin of 0 auto the colour disappears completely.

body{
 font-family: Trebuchet, Arial, Helvetica;
 font-size:15px;
line-height:1.5;
padding:0;
margin:0;
background-color:#0a1612

}
/* Global */
.container{
width:80%;
margin:auto;
overflow:hidden;
background:#c5c1c0

}
/* Header */
header {
 background:#f7ce3e
 width: 90%;
 margin: 0 auto;

  }

Upvotes: 0

Views: 321

Answers (1)

Gagik
Gagik

Reputation: 169

In header section after background:#f7ce3e ; semicolon is missing. that's why all the styles that goes after it isn't being applyed. Here is fixed example.

body{
font-family: Trebuchet, Arial, Helvetica;
font-size:15px;
line-height:1.5;
padding:0;
margin:0;
background-color:#0a1612;

}
/* Global */
.container{
width:80%;
margin:auto;
overflow:hidden;
background:#c5c1c0;
}
/* Header */
header {
 background:#f7ce3e;
 width: 90%;
 margin: 0 auto;
padding: 0 5%;
  }
<header> Lorem ipsum dolor sit amet consectetur, adipisicing elit. Repudiandae consectetur voluptas reiciendis officiis nisi, eius recusandae odio voluptatum quod modi aliquid iste distinctio accusamus placeat maiores quam possimus! Eius, animi. </header>
<div class="container">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis iste quam unde omnis ex debitis assumenda atque, quae voluptatibus temporibus. Ratione perspiciatis incidunt fuga laudantium magnam tempora eligendi nesciunt quis.</div>

Upvotes: 1

Related Questions