Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Flask - show flash messages in same place, not at top of page
{% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }}"
                    style="margin-right: -500px; margin-left: -500px; text-align: center;">
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}
{% endwith %}

I have an app which has a long page, when performing an action with a flash message, is it possible for the flash message to show in the current place, rather than going to the top of the page?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can use position:fixed to make your div fixed on the page.

I have also made it to popup in center of page.

<div class="alert alert-{{ category }} "style="position:fixed; left: 50%; transform: translate(-50%, 0);">
                        {{ message }}
                    </div>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!