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

158
Views
cómo convertir un logotipo de Navbar (logotipo, Vista ('Inicio', ... del módulo Flask-Nav a un enlace en el que se puede hacer clic)

en la parte del código python (como app.py) en la parte de la barra de menú podemos definir nuestra barra de navegación como:

 # Define navbar with logo # ####################################################### logo = img(src='/static/img/logo192.png', height="55", width="70", style="margin-top:-15px", ) # here we define our menu items nav = Nav() # registers the "top" menubar nav.register_element('top', Navbar(logo, View('Home', 'index'), View('LogIn', 'login'), View('SignUp', 'signup'), ))

código parte html en mi plantilla:

 <body> <div class="navbar navbar-fixed-top"> {% block navbar %} {{nav.top.render()}} {% endblock %} </div>

No se puede hacer clic en una imagen del logotipo. ¿Cómo puedo hacer para que esta imagen se pueda hacer clic en cualquier enlace?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

es posible si agregamos un script a mi archivo de plantilla

después de agregar un atributo de identificación a <img:

 # Define navbar with logo # ####################################################### logo = img(id='logo', src='/static/img/logo192.png', height="55", width="70", style="margin-top:-15px", )

y puede cambiar una etiqueta <img a una etiqueta <a con scripts js como:

 </body> {% block scripts %} {{super()}} <script> var initi = document.getElementById('logo').outerHTML; console.log(initi); var code = '<a id = "alogo" href="">' + initi + '</a>'; console.log(initi); window.addEventListener('load', function(event) { document.getElementById('logo').outerHTML = code; document.getElementById('alogo').href ="{{ url_for('image_map') }}" }); </script> {% endblock %}
about 4 years ago · Juan Pablo Isaza 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!