Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
change link color on hover in NextJs

I am new to NextJs and I am trying to make a website with a responsive navbar, in that navbar when I hover over on the link it turns out to be blue in color but I don't want that color I just want to change its color on hover how can I do that this is what I have done so far:

import React from 'react';
import Image from 'next/image';
import Link from 'next/link';
import styles from '../../styles/Navbar.module.css';

export default function NavBar() {
    return (
        <>
            <nav className='navbar navbar-expand-lg navBg'>
                <div className='container flex-lg-row flex-nowrap align-items-center'>
                    <div className="navbar-brand" id="brand_img">
                        <a className='logo-dark' href="/">
                            <Image src="/logo.png" alt="Logo" layout='intrinsic' width={200} height={70} />
                        </a>
                    </div>
                    <ul className={styles.menuList}>
                        <li className={styles.menuItem}><Link className={styles.menuLink} href='/'>Home</Link></li>
                        <li className={styles.menuItem}><Link className={styles.menuLink} href='/About'>About Us</Link></li>
                        <li className={styles.menuItem}><Link className={styles.menuLink} href='/'>Plans</Link></li>
                        <li className={styles.menuItem}><Link className={styles.menuLink} href='/'>Blog</Link></li>
                        <li className={styles.menuItem}><Link className={styles.menuLink} href='/'>Features</Link></li>
                    </ul>

                    <div>
                        <button className="btn btn-light">Sign In</button>
                    </div>
                </div>
                <style jsx>
                    {`.navBg{
                        background-color: #2b2a28;
                        color: white;
                     }
`}
                </style>
            </nav>
        </>
    )
}

Below is my CSS file:

.menuList {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.menuItem {
    margin-right: 2rem;
    font-weight: 700;
}

.menuItem .menuLink:hover {
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid white;
}
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You're supposed to have <a> element inside the Link element and add your classname there. So you should do this:

<Link href='/'><a className={styles.menuLinkFeatures}>Features</a></Link>
about 4 years ago · Juan Pablo Isaza Denunciar

0

your code is correct i don't understand why its not working maybe try

'refreshing the page or check the import path to make sure you imported correctly'.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda