John Ruggiero
John Ruggiero

Reputation: 61

Need to style an h1 as h3 in wordpress

Our company website wants me to redo one of our pages that is currently using h3 and h4 tags with h1 and h2 tags, respectively. They want to maintain all the styling, and want to make the change for SEO purposes. I have tried to specify a class for the h1's on the page as

<h1 class="specialh1">

but this is being overridden by some css that applies to all h1's that displays the header as a background image. Can I force the h1 to only use the class's css?

Upvotes: 0

Views: 214

Answers (2)

Yogee
Yogee

Reputation: 1452

You can assign another class to your h1 tag that you don't want script to override and run your own script once page load to remove all class for those h1 with class 'specialh1' in them. This is easier if you are using Jquery

$('.specialh1').removeClass().addClass('specialh1');

Upvotes: -1

Michael
Michael

Reputation: 7092

Add !important to all your CSS rules for the class specialh1. For example...

.specialh1 {
font-weight: bold !important;
}

Upvotes: 2

Related Questions