<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style>
        .score{
            width: 12em;
            height: 4em;
            line-height: 4em;
            text-align: center;
            vertical-align: middle;
            border: 2px solid black;
            border-radius: 0.5em;
        }

        .excellent{
            background-color: purple;
            color: white;
        }

        .lhz{
            background-color: greenyellow;
        }

        .middle{
            background-color: yellow;
        }

        ._60{
            background-color: orange;
        }

        ._59{
            background-color: red;
        }

        .worse {
            background-color: red;
        }
    </style>
</head>

<body>
    {% if score >= 90 %}
    <div class="score excellent">优秀</div>
    {% elif 80 <= score < 90 %}
    <div class="score lhz">良好</div>
    {% elif 70 <= score < 80 %}
    <div class="score middle">中等</div>
    {% elif 60 <= score < 70 %}
    <div class="score _60">及格</div>
    {% elif 59 <= score < 60 %}
    <div class="score _59">恭喜你，差点就及格了</div>
    {% else %}
    <div class="score worse">不及格</div>
    {% endif %}
</body>

</html>