Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Adding CSS/JS files to Html file not working

Sorry this question might look a little bit ugly but I am new to web dev.

I try to add some css/js files into my html and here is the structure.
May I understand where I get wrong for the path?
Thanks

Here is the stucture layout.
I have tried href="../assets/css/ud-styles.css" but still not working

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In jinja2 templates that flask uses you need a "static" folder for you styles.
So you need to create a folder named "static" beside your template folder, inside this "static" folder you create a folder named "style" move the css folder inside this new "style" folder which is inside "static" and you link it using this:

<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='style/css/ud-styles.css.css') }}">
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading