简体   繁体   中英

Can we add itemscope & itemtype on <HTML> tag for microdata schema?

<html lang="en" itemscope itemtype="http://schema.org/ApartmentComplex">
   ---
   ---
   ---
</html>

Is it a good practice to add itemscope on <html> tag?

I would personally avoid doing that unless it was for a WebPage entity or subtype. Scoping the whole document for a type like that would make it hard to add other entities to the page. eg BreadcrumbList

Absolutely you can add any type on the root <html> element.

And yeah @Tony's view is right that if you may ever in future or anyone else want to add up some more semantic markup and vocabulary, like BreadcrumbList type which can be linked to Webpage type, then <html> element would need a parent element which would not be possible in your case, therefore it would not be recommended.

Although there is another case , I've'nt practically used it, where Schema.org implicitly consider every web page as Webpage type(Search Engine's view) and therefore it would be certain to add up any type to the html page or to the root element as you did, without affecting the page's implicit WebPage type declaration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM