Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda