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

174
Vistas
how do I style a child div in nextjs using css

I am working on the menu bar of a website.

I am using nextjs for my application

I want to style the a tag

but it did not work

My code

Javascript

const Nav = () => {
    return (
        <div className={styles.nav}>
            <div className={styles.topNav}>
                <div className="d-flex justify-content-between">
                    <div>
                        <Link href="/">
                            <a>
                                Logo
                            </a>
                        </Link>
                    </div>
                    <div className={styles.navLinks}>
                        
                    </div>
                    <div onClick={openMenu} className={styles.menuHamburger}>Menu</div>
                </div>
            </div>
        </div>
    )
}

CSS

.topNav{
    background-color: blue;
    padding: 1.5rem 1rem;
}

.topNav > div > a{
    color: white;
}


    
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You used the child selector > in .topNav > div > a, meaning you're only styling an <a> that is the child of a <div> that is the child of an element with the .topNav class. Your <a> is only a descendant here. You can use a space instead to specify any descendant: .topNav > div a

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