why my CSS for H3 will impact article title?

Posted in: Newspaper
Post count: 3

If I apply CSS code for H3, it will impact my homepage article title and sidebar article title.
May I know how to fix it?
Original Home page look
Home page with CSSArticle content original lookArticle content with CSS

Below is my CSS
h3{
counter-reset: money;
counter-increment: section;
margin-top: 2.4rem;
font-size: 1.4rem;
line-height: 1.6;
}
h3:before{
content: counter(chapter) “.” counter(section);
color: #fff;
background-image: linear-gradient(45deg, #000000 0%, #000000 1%, #000000 100%);
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
border-radius: 50px;
padding: 0.2rem 0.5rem;
margin: 0 0.8rem 0 0;
}

Post count: 21065

Hello!

If you will write the code like that of course it will apply for all h3 elements on your entire website. Where exactly do you want to change the design? And please also provide me a website link in order to take a closer look which element you need to modify.

Thank you!

Post count: 3

Yes, I know CSS will apply for all h3 elements, may I know if there’s any way to let CSS ONLY apply for article content h3?
My website link

Post count: 21065

Hello!

Try to insert this class in the front of your code:

.tdb_single_content h3{
counter-reset: money;
counter-increment: section;
margin-top: 2.4rem;
font-size: 1.4rem;
line-height: 1.6;}

and

.tdb_single_content h3:before{
content: counter(chapter) “.” counter(section);
color: #fff;
background-image: linear-gradient(45deg, #000000 0%, #000000 1%, #000000 100%);
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
border-radius: 50px;
padding: 0.2rem 0.5rem;
margin: 0 0.8rem 0 0;
}

Let me know about your results!

Thank you!

Post count: 3

Hi Bettina,

AWESOME! It works! Thanks for help!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.