Why do I receive the following error when scanning an AMP web page:
“The "[class]" attribute is not valid for the "div" element. Some valid attributes for this element are: "accesskey", "amp-access", "amp-access-hide", "autocapitalize", "class", "contenteditable", "contextmenu", "dir", "draggable", "dropzone", "enterkeyhint", "fallback", "hidden", "id", "inert", "inputmode", "is", "lang", "nonce", "placeholder", "role", "spellcheck", "style", "tabindex", "title", "translate", "vocab", "aria-*" attributes, "item*" attributes, and "on" attributes (like event handlers).”
I checked the official website and even they use [class] attribute for div elements: line 642 “<div class="empty" [class]="query ? '' : 'empty'">” on view-source:https://amp.dev/
The official AMP validator does not throw any error for using [class] attribute on div element.
The page where I get the error is: https://vopsele.xyz
Amp error
-
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
Re: Amp error
Hello,
Thank you for the report.
AMP web page validation is limited because there wasn't a lot of demand for it in CSS HTML Validator so it hasn't been maintained, however, I would be happy to further improve the program's usefulness for validating AMP documents if easily possible.
I will look into this this week and reply back with further information. Please feel free to provide more feedback if you think it would be helpful for improving CSS HTML Validator's AMP validation support.
Thank you for the report.
AMP web page validation is limited because there wasn't a lot of demand for it in CSS HTML Validator so it hasn't been maintained, however, I would be happy to further improve the program's usefulness for validating AMP documents if easily possible.
I will look into this this week and reply back with further information. Please feel free to provide more feedback if you think it would be helpful for improving CSS HTML Validator's AMP validation support.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
Re: Amp error
Hello,
Please check for updates and try v19.0303 (which is now available for the pro edition). It should ignore attributes in square brackets for AMP HTML documents.
Please check for updates and try v19.0303 (which is now available for the pro edition). It should ignore attributes in square brackets for AMP HTML documents.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank 0 - Newcomer
- Posts: 5
- Joined: Sat Oct 12, 2019 6:33 am
Re: Amp error
Thank you very much.
Now it seems to be ok.
Now it seems to be ok.
-
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
Re: Amp error
Great! I'm glad it is OK now. Thank you for letting me know.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
Re: Amp error
UPDATE: We've significantly improved AMP HTML checking for the upcoming major release (2020/v20). If you'd like to test an early BETA of it and provide feedback then please send me a private message.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial