I'm currently using a Flask server to host an HTML file for testing purposes. Within the head of this HTML file, I have linked to a locally stored animate.min.css file (
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='animate.min.css') }}">
).
Even though I can see the linked CSS file in the inspector and open it, the styles do not seem to work as intended (for example, <h1 class="animated zoomIn">Index Page</h1>
does not display the animation).
Strangely, when I use a file from a CDN (<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
), the effect works perfectly fine.
I'm unsure why this is happening. Could it be that I am missing something or doing something incorrectly? This is my first time working with this, so any guidance would be greatly appreciated. Please let me know if more information is needed.
Here is the complete code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='animate.min.css') }}">
<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">-->
<script src="{{ url_for('static', filename='jquery-3.5.1.min.js') }}"></script>
</head>
<body>
<h1 class="animated zoomIn">Index Page</h1>
</body>
</html>
Directory structure:
- Server
- static
- animate.min.css
- jquery-3.5.1.min.js
- templates
- index.html
- server.py
- static
Note:
- The jQuery import is functioning correctly
- I am able to access the "animate.min.css" file at "localhost:5000/static/animate.min.css"
Thank you for your assistance.