Jump to content
Sarfaraj

Just want to know if my HTML code is correct?

Recommended Posts

HI,

Can I take header and article tag inside a section.
I just want to know if my HTML code is correct, please check my code below

<section>
	<header>What happened on this day in History?</header>
	<article>
		<h2>A heading here</h2>
		<p>Some additional information here</p>
	</article>
</section>

<section>
	<header>What happened on this day in History?</header>
	<article>
		<h2>A heading here</h2>
		<p>Some additional information here</p>
	</article>
</section>

 

Share this post


Link to post
Share on other sites

It is valid HTML, but it would be better for search engines if the content between the <header> tags was also wrapped in <h2> tags. The tags in the article block would then be <h3>.

Share this post


Link to post
Share on other sites

Your code is correct,  but as of coding standards you can declare heading tag <h1>...<h6> at a one time.You can't declared multiple times h2.

Share this post


Link to post
Share on other sites
1 hour ago, Sherin said:

Your code is correct,  but as of coding standards you can declare heading tag <h1>...<h6> at a one time.You can't declared multiple times h2.

Utter tosh!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...