如何定位特定div ID的标题? [英] How to target headings for a specific div ID?
本文介绍了如何定位特定div ID的标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我试过的:
#header h1,h2,h3,h4 {
font-family:'Helvetica';
}
但这会导致所有h1 / 2/3/4标签使用Helvetica字体,无论他们是否在头div中。我相信我错过了一些简单的,任何人都可以帮助?谢谢!
解决方案
我认为你必须这样做:
#header h1,#header h2,#header h3,#header h4 {
font-family:'Helvetica';
}
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!
解决方案
I think you must do so:
#header h1,#header h2, #header h3, #header h4 {
font-family:'Helvetica';
}
这篇关于如何定位特定div ID的标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文