I wan't to change a css line from python/Flask/Jinja2 in my css file like this:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
<link href="{{ url_for('static', filename='./css/index.css') }}" rel="stylesheet" type="text/css" />
<link rel="icon" href="{{ url_for('static', filename='./img/icon.png') }}">
</head>
<body>
<div class="marquee">
<div class="v-align">
<p style="font-size:20vh;"><b>{{ text }}</b></p>
</div>
</div>
</body>
</html>
CSS:
.v-align {
font-size: 120px;
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.marquee {
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
box-sizing: border-box;
color: "red";
}
.marquee p {
display: inline-block;
padding-left: 100%;
animation: marquee 30s linear infinite;
}
@keyframes marquee {
0% { transform: translate(0, 0); }
100% { transform: translate(-100%, 0); }
}
I want to replace the 30s by any value when rendering it with python.
Python:
return render_template("my_html_file.html", text="this is a test!", animation_time="30s")
It seems to be impossible to make it in thr CSS file like this: animation: marquee {{ animation_time }} linear infinite;
, but maybe I am wrong.
my_html_file.htmlor in a separate.cssfile?