What are the attributes in the html tag?

2

In HTML5, what are the possible attributes that can be used in the element (tag) html ? I've always learned the attributes by studying W3Schools , but I noticed that they say nothing about attributes like prefix and xml:lang and even simple ones like alt and disabled , among others that must exist that still do not know. Thank you!

    
asked by anonymous 26.03.2016 / 03:35

1 answer

6
  

W3C! = W3Schools

     

First of all I would like to mention that it is a very common thing for those who start to study and ask questions on google, W3Schools has no connection with W3C or W3.org, they only use the similar name to say that they teach things that contains in W3C, but that does not mean they teach correctly or just HTML / CSS / XML.

     

W3Schools has also been known for the numerous flaws in its examples and tutorials, as well as misunderstandings about some technologies

     

Today we can say that most of the errors in W3Schools have been corrected, but it does not mean that it is official or that it has good examples.

     

On the attributes supported by the <html> tag, it is not because an attribute is incorrect in a tag that it will not work, technologies like HTML, JS, and CSS work similarly in all current browsers, but it does not mean that it was W3.org that implemented them, for example it is not because w3c released HTML5 that it will work equally in all browsers, the W3C is just a kind of "regulator" (who standardizes the technologies) to prevent them from starting there are many differences between browsers which would make it difficult to develop websites (this has happened in the past the famous Browser wars, which goes beyond who is the most used, why one browser wanted to be better than the other created technologies that were not standards, so that caused a lot of headaches.)

As I mentioned in a comment, you do not need to know the A, B, C of something functioning, but look for it in the moment of need. The only utility I see to learn which attributes are all supported by a tag is if you:

  • Will create a Crawler
  • Will create a Javascript library that manipulates the DOM for some very specific purpose

If this is not well, or better if you just create pages to navigate in conventional browsers, then stick to doing the basics and intermediary if you need something advanced like OpenGraph from facebook so you can apply normally, do not worry sites great as they would not create a flawed HTML / XML "scheme," that would "burn their movie".

Microdata or RDFa can block the HTML if it fails at some point in the typing (human error) and for this reason JSON -LD, as I mentioned here: What is the "application / ld + json" type used for in a < script >? But if you do it with care and attention you can still do without obstructing the code, I mean use something when necessary, there are not many reasons to understand the interface .

link leads to this link

Core:

  

accesskey , class , contenteditable , contextmenu , dir , draggable , dropzone , copy , move , link , hidden , id , lang , spellcheck and style

Events:

  

tabindex , title , translate , onabort , onblur , oncanplay , oncanplaythrough , onchange , onclick , oncontextmenu , ondblclick , ondrag , ondragend , ondragenter , ondragleave , ondragover , ondragstart , ondrop ondurationchange , onemptied , onended , onerror , onfocus , oninput , oninvalid , onkeydown , onkeypress , onkeyup , onload , onloadeddata , onloadedmetadata , onloadstart , onmousedown , onmousemove , onmouseout onmouseover , onmouseup , onmousewheel and onpause

XML:

  

onplay , onplaying and onprogress

But I have to remember, no is because the attribute onratechange is listed is that it will work and not is because the attribute onreadystatechange / strong> is listed that will not work (it is very likely to work), the operation in each browser may occur in a totally different way from another (although most are working well today), but it is not because the browser supports something that this use is valid according to the standardization.

In summary default is one thing, function is another. However I always prefer to try to follow the pattern and on rare occasions I make use of some hack (like the common case in CSS) that is not standard to help achieve a goal, often by lack of functionality in a given browser.

    
26.03.2016 / 18:25