8

I am trying to style all the headings in my header with a different font-family than the headings on the rest of the page but I am having trouble getting the style to only apply to the specific header ID.

Here is what I tried:

#header h1,h2,h3,h4 {
    font-family:'Helvetica';
}

But this causes all h1/2/3/4 tags to use the Helvetica font regardless of if they are in the header div or not. I'm sure I am missing something simple, can anyone help? Thanks!

Kara
  • 6,115
  • 16
  • 50
  • 57
user3101431
  • 407
  • 2
  • 8
  • 15

2 Answers2

13

I think you must do so:

#header h1,#header h2, #header h3, #header h4 {
    font-family:'Helvetica';
}
chris
  • 4,827
  • 6
  • 35
  • 53
3

You need to target all hN with the ID.

#header h1, 
#header h2, 
#header h3, 
#header h4 {
    font-family:'Helvetica';
}

See Fiddle

putvande
  • 15,068
  • 3
  • 34
  • 50