Cloudflare AMP validator issue

I want to use Cloudflare amp validator api (, but it looks like validator doesn’t work correctly, because i get error:
{“line”:220,“col”:0,“code”:“DISALLOWED_STYLE_ATTR”,“error”:“The inline ‘style’ attribute is not allowed in AMP documents. Use ‘style amp-custom’ tag instead.”,“help”:“”}
Line from error:
<div class='myclass' style='background-image: url(/uploads/test.png)'></div>

But in ampproject docs ( i can see:

Styles may live in the head of the document or as inline style attributes

So, looks like inline styles are allowed, and validation was success when i’ve used amp validator browser extension.
Cloudflare Amp validator api not maintained for now? Or how I can fix this?


This topic was automatically closed after 14 days. New replies are no longer allowed.