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'.
What you need first, is to use @media queries, you can do it either in the CSS file itself, or in the html file. What you have to do, is add some extra rules only for smartphones, below your normal css rules. Using the example below, you add inside the curly brackets the lines you need to change your normal CSS to one that mobile devices can use.
Take your JavaScript to the next level at Frontend Masters . The Accelerated Mobile Pages (AMP) Project is an initiative to improve the mobile web and enhance the distribution ecosystem.
The Accelerated Mobile Pages (AMP) Project is an initiative to improve the mobile web and enhance the distribution ecosystem. If content is fast, flexible and beautiful, including compelling and effective ads, we can preserve the open web publishing model as well as the revenue streams so important to the sustainability of quality publishing.
Overview This codelab is a continuation of the concepts introduced in Accelerated Mobile Pages Foundations. You should already have completed the previous code lab before starting this lab or at least have a basic understanding AMP's core concepts already.
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.
i am using php pages so I do the following to add my custom css page, so i can seperate it and also include in all pages so changing only once etc.
<style amp-custom>
<?php readfile( getcwd() . "/css/main.min.css"); ?>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With