# Can't Apply a Style to the Header

**URL:** <https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999>\
**Category:** Uncategorized\
**Created:** [November 20, 2020, 2:17am UTC](https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999 "2020-11-20T02:17:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)\
**Post date:** [November 20, 2020, 2:17am UTC](https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999/1 "2020-11-20T02:17:47Z")

</div>

The Prehistory Era h1{background: rgb(233, 233, 117); margin: 40px; padding: 20px;} header{ background: rgb(236, 187, 195); margin: 20px padding; 30px } section{background: rgb(204, 155, 50); opacity: .8; margin: 20px; padding: 30px;} footer{margin: 30px; padding: 50px;}

# The Dawn of Man
The Neanderthals Geographical Distribution Era of Dominance Footer

So what gives here? I can apply a style to all the elements - h1, section, footer - but not to the header - how come ? Changing margin / padding values has no effect on the display.

 ![Screen Shot 2020-11-19 at 7.09.26 PM](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/2X/c/cc448e1ae276812a1cd211b528dccf87c9bf87cf.png)

---

<div class="post-metadata">

**Author:** ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)\
**Post date:** [November 20, 2020, 2:19am UTC](https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999/2 "2020-11-20T02:19:39Z")

</div>

```
<!DOCTYPE html>
<html>
<head>
   <title>The Prehistory Era</title>
   <style>
       h1{background: rgb(233, 233, 117);
       margin: 40px;
       padding: 20px;}
       header{
           background: rgb(236, 187, 195);
           margin: 20px
           padding; 30px
       }
       section{background: rgb(204, 155, 50);
       opacity: .8;
       margin: 20px;
       padding: 30px;}
       footer{margin: 30px;
       padding: 50px;}
   </style>
</head>
<body>
    <h1>The Dawn of Man</h1>
<header>The Neanderthals</header>   
<section>Geographical Distribution</section>
<section>Era of Dominance</section>
<footer>Footer</footer>
</body>
</html>
```

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [November 22, 2020, 11:30pm UTC](https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999/3 "2020-11-22T23:30:19Z")

</div>

Try setting `display: block;` to the header style rule. Does that fix it?

---

<div class="post-metadata">

**Author:** ![John\_Stern](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/john_stern/32/12050_2.png) [@John\_Stern](https://forum.kirupa.com/u/John_Stern)\
**Post date:** [November 23, 2020, 3:57pm UTC](https://forum.kirupa.com/t/cant-apply-a-style-to-the-header/644999/4 "2020-11-23T15:57:23Z")

</div>

header{  
background: rgb(236, 187, 195);  
margin: 20px  
padding; 30px  
}

```
   // Hi Kirupa - thanks for your response - display: block; - did not make 
   a difference but as I looked closely at your suggestion, I realized
   that I had a ; following padding instead of the required : - and in the 
   margin line, I forgot the ; at the end of the line - I didn't see
   any of this the first time I wrote the code and it took your
   suggestion to spark me into awareness of the errors. Thanks!
```
