1

please i want someone to help me.

since h1 tag is expected to appear once in a file for SEO reason, i want to make some text have the same attribute to as h1 by putting it in the css file or function.php and call it as class anywhere in the files.

if there is default class for this please help me with it but if not can someone makeup the php script for me.

thanks in advance as you help.

5
  • you can use the shortcode Aug 17, 2017 at 15:01
  • i don't want to use h1, i can use something like this <div class="heading1">Don't Miss These Information</div> where "heading" will be clone function for H1..... can you help me to define the class "heading1" for css
    – Onuwa O
    Aug 17, 2017 at 15:11
  • Can't really understand what you mean. Could you please make an example?
    – Johansson
    Aug 17, 2017 at 15:11
  • i don't want to use h1, i can use something like this <div class="heading1">Don't Miss These Information</div> where "heading" will be clone function for H1..... can you help me to define the class "heading1" for css
    – Onuwa O
    Aug 17, 2017 at 15:16
  • If your want to make a class like you h1 styling. Then you have to make a class (heading1) in your style.css file and assign all the perperties of h1 to your class(heading1). If you are unable to understand which all properties of h1. Then simple to go your website homepage and right click and select inspect element and copy all the properties. Aug 17, 2017 at 18:28

1 Answer 1

2

I think what you're trying to do is replicate the h1.

What you need to do is open your css file and look for the h1 call.

it will look like:

h1 {
font-size: 22px;
color: blue;
}

The code inside isn't important; it's finding that h1 selector.

Now add your class as an addition to the selector:

h1, .headingclass {
font-size: 22px;
color: blue;
}

(notice the comma after h1 and the name of your class w/ a period.)

That will make heading class look like h1.

If your theme is making the h1 class dynamically set it how you want in your themes option and then use developer tools (f12 on your browser) and find the the style being placed over h1. Copy and put this into your style.css, then change the selector to .headingclass so something just like this:

.headingclass {
font-size: 22px; //or whatever the actual code is
color: blue; //or whatever the actual code is
}

The last option is to choose one of your other standard headings (h2,h3,h4,h5,h6) that you wouldn't use very often and then apply the same styling to it as you did to h1. This is easier to implement for you later when the site is being used.

2
  • i don't understand this is the code i found in my Style.css h1, h2, h3, p { margin: 0 0 5px 0; padding: 0; }
    – Onuwa O
    Aug 17, 2017 at 16:26
  • anything else with h1? it would be in your theme style.css. link to site?
    – rudtek
    Aug 17, 2017 at 16:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.