Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include CSS file in AMP project

Tags:

amp-html

<style amp-custom>
{% include "style.css" %}
</style>

I am trying to create a simple AMP-site and got some problem. What is {% %}? It doesn't work for me?

like image 742
Vrea Avatar asked Dec 06 '25 08:12

Vrea


2 Answers

You can try it, it's working for me...

<style amp-custom>
     @import url('css/custom.css');
</style>
like image 148
Sheo Sagar Avatar answered Dec 09 '25 21:12

Sheo Sagar


You can’t reference external stylesheets amp pages, styles must be inlined under style tag with amp-custom attribute

<style amp-custom>

</style>

reference: amp styling doc

like image 41
lakki Avatar answered Dec 09 '25 20:12

lakki