Accelerated mobile pages link to css file

osmanraifgunes picture osmanraifgunes · Mar 20, 2016 · Viewed 7.7k times · Source

I am trying to link to css file :

<link href="/semanticui/semantic.css" rel="stylesheet" />

Opening chrome in #development=1 mode to test my page for amp. I am getting this error :

The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/semanticui/semantic.css'.

Answer

Jeff Deskins picture Jeff Deskins · Mar 21, 2016

External stylesheets are not permitted. Use inline styling to avoid the additional request for css.

More info can be found at: https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#stylesheets

Authors may add custom styles to a document using a single <style amp-custom> tag in the head of the document.