BlackStar1991
BlackStar1991

Reputation: 284

What tags can I use in <h1> and other topic tags?

Can I use other tags into h1 tag, (or h2, h3, h4 .. etc ) ? For example:

span {
  color: red;
}

strong {
  text-decoration: underline;
}
<h1>My <span>example</span> text</h1>
<h2>Can I <strong>use</strong> it?</h2>
<h3>Why I you </br> think so ... ? </h3>

Will it be these code valid and looks ok in SEO ?

Upvotes: 1

Views: 1885

Answers (2)

ThunderMind
ThunderMind

Reputation: 799

Heading tags are beneficial for presenting content in an organized manner. In SEO perspective, it is always good to present data in a way that is easy for crawlers to crawl and get your website/web pages indexed. Using these tags makes easier for search engine crawlers to crawl your web pages effectively.

Using other tags can enhance readability and user experience for the webpage but using heading tags inside heading tags might harm your SEO. For SEO purpose, it is important to follow up SEO Guidelines for your website/webpage.

Hope these will help you understand more:

https://www.searchenginejournal.com/important-tags-seo/156440/ https://www.seoblog.com/2017/06/changing-tags-hurt-seo/

Upvotes: -1

Quentin
Quentin

Reputation: 944556

Will it be these code valid

To answer this type of question, you should look at the HTML specification.

The section on heading elements says:

Content model: Phrasing content.

which links to:

a abbr area (if it is a descendant of a map element) audio b bdi bdo br button canvas cite code data datalist del dfn em embed i iframe img input ins kbd label link (if it is allowed in the body) map mark MathML math meter noscript object output picture progress q ruby s samp script select small span strong sub sup SVG svg template textarea time u var video wbr text

You can also test your code with a validation tool.

Note that </br> is never valid in HTML. It is an element where the start tag is mandatory and the end tag is forbidden.

looks ok in SEO ?

SEO questions of this nature are off-topic. You might try Webmasters instead.

Upvotes: 2

Related Questions