Does the style element really have an identifier?

It says that it is not in HTML4, although I really do not see where it is indicated in the text. From what I can say, based on this , it's ok to do in HTML5, but I'm not quite sure (assuming style is an HTML element?)

I use this to rotate the stylesheet and want it to be as reliable as possible according to the HTML5 specifications, so we wonder if I should rewrite it using the data- * element.

+5
source share
3 answers

+1 An interesting question!

style (link) , id class.


, title style HTML5. .

http://www.w3.org/TR/html5/semantics.html#the-style-element

Fyi...

<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
    <style title="whatever"></style>
  </head>
  <body>
    Test body
  </body>
</html>

http://validator.w3.org/#validate_by_input+with_options

+2

W3C, :)

<!DOCTYPE html>
<html>
  <head>
    <title>Title</title>
    <style id="test"></style>
  </head>
  <body>
    Test body
  </body>
</html>

, W3C Validator - , , , .

+1

HTML4 ( ), data- * . Doctype, .

Regardless of whether the document is checked or not, browsers will ignore elements that they do not recognize.

Style tags are DOM elements, like any other tag, so you can add any attributes you need.

+1
source

All Articles