- From: Jukka K. Korpela <jukkakk@gmail.com>
- Date: Thu, 11 May 2023 12:25:11 +0300
- Cc: Werbeschmiede AG <info@werbeschmiede.ch>, www-validator@w3.org
- Message-ID: <CAGHxYa5fmJ9_JZU=QF8kvss609qC1P1FQNwo0x=i-tNCamD=PQ@mail.gmail.com>
Philip Taylor (RHBNC) (P.Taylor@rhul.ac.uk) wrote: > The "id" attribute is not permitted for "style" elements — see > https://html.spec.whatwg.org/multipage/semantics.html#the-style-element > The id attribute is allowed on all elements. On the page about global attributes, it is not included in the list at the start, but later the page says: T“he class, id, and slot attributes may be specified on all HTML elements.” https://html.spec.whatwg.org/multipage/dom.html#global-attributes So the attribute is not a problem. The problem is the placement of the style element. It is allowed inside the head element only. There have been changes between versions of HTML; see e.g. https://stackoverflow.com/questions/2830296/using-style-tags-in-the-body-with-other-html Anyway, the “Living HTML standard” is what the validator uses as the definition, and it currently allows a style element inside the head element only. > When will it be fixed? > > When Wordpress / Gutenberg cease generating defective code (or when > Armageddon occurs, whichever comes first). > (or when the Living HTML standard is changed). Probably WordPress / Gutenberg should just generate a bit more verbose CSS code, since the point in generating code like that seems to be to avoid repeating a class selector in CSS rules. Yucca, https://jkorpela.fi
Received on Thursday, 11 May 2023 09:25:28 UTC