Right now my header contains two p-tags with different styles:
<p style="color:#FFF; font-size:34px; margin-bottom:10px;">First half</p>
<p style="color:#FFF; font-size:88px;">Second half</p>
Is it possible to convert this into one h1-tag? Or can I have two h1 after each other? The main purpose is that it should work well with seo.
The Truth About Multiple H1 Tags and SEO. Our conclusion is that while it's fine to stick with one H1 per page, multiple H1s can be used as long as they are not being overused to the point of spamming, and the H1s fit contextually within the structure of the page.
It is common to have multiple H1 heading tags in different parts of your page, in your website's template, theme or other sections. Regardless of whether you use HTML5 or not, having multiple H1 elements or multiple heading tags of the same type on a page is completely fine.
You can add multiple styling properties at once when using the HTML style attribute - just make sure to separate the name-value pairs with commas. Using a separate stylesheet is very convenient for styling multiple pages, as it's easier to apply changes to one document than to each page separately.
SEO-wise - each web page should contain one H1 tag. A possible solution for what I believe you're trying to achieve is adding span tags in your H1 enabling you to style each part of your H1 differently:
HTML:
<h1>
<span class="smallerFont">First half</span>
<span class="bigFont">Second half</span>
</h1>
CSS:
h1 {
color: #fff;
}
.smallerFont {
font-size: 34px;
margin-bottom: 10px;
}
.bigFont {
font-size: 88px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With