Accelerated mobile page links for css file

I am trying to establish a link to a css file:

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

Opening chrome in #development=1 mode to check my page for an amplifier. I get this error:

 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '/semanticui/semantic.css'. 
+5
source share
3 answers

External style sheets are not allowed. Use inline style to avoid extra request for css.

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

Authors can add their own styles to the document using a single <style amp-custom> at the beginning of the document.

+14
source

I use php pages, so I add my custom css page so that I can share it and also include on all pages so that they change only once, etc.

 <style amp-custom> <?php readfile( getcwd() . "/css/main.min.css"); ?> </style> 
+7
source

Any style of the page and its elements is performed using common CSS properties. Style elements using class selectors or elements in the built-in style sheet in the name <style amp-custom>

here is a sample code:

 <style amp-custom> /* any custom style goes here */ body { background-color: white; } amp-img { background-color: gray; border: 1px solid black; } </style> 
0
source

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


All Articles