0

I have a flask server which hosts a html file for testing. In the head of this html I want to link to a localy stored animate.min.css file (<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='animate.min.css') }}"> ). When I open the page I can look in the insepector and see the linked css file (and I can open it) but the style doesn't work (e.g. <h1 class="animated zoomIn">Index Page</h1> won't do the animation). However 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">) it works and the effect is be visible.
Why is that? Am I doing something wrong? It's my first time using it so I don't have much experience. Please ask if some information is missing.

Whole 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

Note:

  • The jQuery import is working
  • I can access the "animate.min.css"-file under "localhost:5000/static/animate.min.css"


Thanks in advance.

29thDay
  • 83
  • 1
  • 9

2 Answers2

1

Check if u need a earlier or more current version. Have that issue time to time that only one component gets updated and is now not useable with the other anymore.

0

Had the same problem (Animate.css won't work when loaded locally). Worked fine from CDN but not when I had it in a local directory. I put the CDN link into my browser and copied the entire file to my local folder. Renamed it animate.css and it worked fine. The version I copied was 4.1.1. the version I was using was 3.7.

Thanks to Makoto Niijima.