How to target headings for a specific div ID?

user3101431 picture user3101431 · Jan 10, 2014 · Viewed 11.9k times · Source

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!

Answer

chris picture chris · Jan 10, 2014

I think you must do so:

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