Can I target all tags with a single selector?

后端 未结 10 1672
予麋鹿
予麋鹿 2020-12-04 08:44

I\'d like to target all h tags on a page. I know you can do it this way...

h1,
h2,
h3,
h4,
h5,
h6 {
  font: 32px/42px trajan-pro-1,trajan-pro-2;
}

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-04 09:31

    SCSS+Compass makes this a snap, since we're talking about pre-processors.

    #{headings(1,5)} {
        //definitions
      }
    

    You can learn about all the Compass helper selectors here:

提交回复
热议问题