How to set target headers for a specific div id?

I am trying to create all the headings in a heading with a different font family than the headings on the rest of the page, but I am having trouble getting the style to apply only to a specific heading identifier.

Here is what I tried:

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

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

+8
css stylesheet html-heading
source share
2 answers

I think you should do this:

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

You need to target all hN with an id.

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

See Fiddle

+3
source share

All Articles