Pipe templates in HTML classes

I could not find anything in the W3C docs that the specified pipe characters,, |are not allowed, for example:

<div class="class1|class2">

Don’t worry about why I can use it. I just wondered if this is "legal".

+3
source share
2 answers

The corresponding rules can be found in the w3c syndata tokenization section , although it is rather difficult to conclude if the pipe is valid or not, at first glance it seems that something is valid for the selector, i.e.

selector    : any+;
any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
              | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
              | DASHMATCH | ':' | FUNCTION S* any* ')' 
              | '(' S* any* ')' | '[' S* any* ']' ] S*;
+2
source

HTML, - CDATA. CSS, .

+1

Source: https://habr.com/ru/post/1748060/


All Articles