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

129
Views
Elemento de enlace que no se muestra cuando se selecciona y se aplica estilo como n de tipo

https://codesandbox.io/s/damp-worker-k7fj6y?file=/src/App.js

¿Por qué no se muestra .row:nth-of-type(1) > .content:nth-of-type(4) .content <Link/> ?

¿Es un error, me estoy perdiendo algo?

 import "./styles.css"; import { Link } from "react-router-dom"; export default function App() { return ( <div className="App"> <div className="row"> {/* I dont want this div to be a Link */} <div className="content"></div> <Link to="/" className="content"></Link> <Link to="/" className="content"></Link> <Link to="/" className="content"></Link> </div> <div className="row"> <Link to="/" className="content"></Link> <Link to="/" className="content"></Link> <Link to="/" className="content"></Link> <Link to="/" className="content"></Link> </div> </div> ); }
 .App { height: 100vh; width: 100vw; } .row:nth-of-type(1) { height: 500px; width: 100%; display: grid; grid-template-areas: "aabc" "aadd"; grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 20px; } .row:nth-of-type(1) > .content:nth-of-type(1) { grid-area: a; background-color: orange; } .row:nth-of-type(1) > .content:nth-of-type(2) { grid-area: b; background-color: blue; } .row:nth-of-type(1) > .content:nth-of-type(3) { grid-area: c; background-color: green; } .row:nth-of-type(1) > .content:nth-of-type(4) { grid-area: d; background-color: red; }

donde esta el contenido rojo

No estoy buscando un enfoque alternativo para lograr el mismo resultado, simplemente estoy preguntando por qué el cuarto <Link/> no se muestra para saber qué está fallando.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use el psuedoselector :nth-child ya que está mezclando tipos de elementos ( div y Link ( a )) , no hay un cuarto elemento de tipo de enlace para diseñar.

 .row:nth-of-type(1) > .content:nth-child(1) { grid-area: a; background-color: orange; } .row:nth-of-type(1) > .content:nth-child(2) { grid-area: b; background-color: blue; } .row:nth-of-type(1) > .content:nth-child(3) { grid-area: c; background-color: green; } .row:nth-of-type(1) > .content:nth-child(4) { grid-area: d; background-color: red; }

ingrese la descripción de la imagen aquí

about 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!