Jump to content

XHTML Question I am unsure of.


PeterBubresko
Go to solution Solved by requinix,

Recommended Posts

I couldn't find a separate forum topic for XHTML, so I'm posting here on HTML.
 I "think" I have over time allowed myself to be tricked into believing, and therefore misunderstood, where and when I should use <HEADER></HEADER> in XHTML. As before and always, there are as many answers as there are questions on the internet. I have been using this error for a long time. I thought it should only be used between <head> and </head> So in one last attempt, I hope to get more unanimous answers here that lead me out of the vicious circle. Now and where is it correct to use <HEADER> and </HEADER> in XHTML? Should those tags be used on one or more elements arbitrarily between the <body> tags, and in which places/tags should they be used.

Link to comment
Share on other sites

  • Solution

XHTML? No, this is just regular HTML...

<header> elements are HTML 5 replacements to writing stuff like <div class="header">, which means things like browsers and screen readers can more accurately understand the nature of a page.

That means they're geared towards content, not metadata. Which means they belong in the document body.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header

  • Like 1
Link to comment
Share on other sites

XHTML was a thing quite some time ago. Modern HTML has the semantic benefits that XHTML (as I understood it at the time) claimed to have, while not being as strict in terms of some of the usage. You'll also find modern HTML referred to as HTML5, though honestly these days I'm not sure if the version number even means anything anymore.

  • Like 1
Link to comment
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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.