A
A
Alex Clean2022-03-27 19:24:38
Layout
Alex Clean, 2022-03-27 19:24:38

I want to style the same h2 on the whole page, how to do it?

Good evening friends. I have a lot of the same h2-h3 headings on my site. They are contained in different blocks (sections). They are all styled one by one: one font size, line-height, etc. That is, they are absolutely identical. I created the name of the classes according to the BAM, that is, for example: header__title - for the header, shop__title - for the store, etc. And here is the question, should I put all these headers together in CSS and set them one style, for example:

.header__title,
.shop__title {
  font-size: 32px;
}


Or is it better to just create some separate class that I will assign to these tags, for example: .main-title

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question