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

242
Views
los estilos aplicados a la línea horizontal a través del archivo css no funcionan

https://codesandbox.io/s/goofy-pasteur-ntcuj

 import "./styles.css"; export default function App() { const separator = { backgroundColor: "#E9E9E9", height: "12px", margin: "8px", borderRadius: "4px" }; return ( <div className="App"> <hr style={separator} /> <hr className="line-separator" /> </div> ); }
 .line-separator { background-color: #e9e9e9; height: 2px; margin: 8px; border-radius: 4px; }

Los estilos aplicados a través de java script funcionan bien, pero no funcionan de la misma manera desde css para la etiqueta <hr /> .

about 4 years ago · Santiago Gelvez
3 answers
Answer question

0

Tu nombre de clase es incorrecto. prueba: <hr className="line-separator" />

Tiene otro error tipográfico en su CSS, su altura debe ser 12px no 2px

about 4 years ago · Santiago Gelvez Report

0

tiene un error tipográfico al configurar className de la segunda hora como "separador". Debe coincidir con el className especificado en el archivo css.

Código correcto:

 import "./styles.css"; export default function App() { const separator = { backgroundColor: "#E9E9E9", height: "12px", margin: "8px", borderRadius: "4px" }; return ( <div className="App"> <hr style={separator} /> <hr className="line-separator" /> </div> ); } .line-separator { background-color: #e9e9e9; height: 2px; margin: 8px; border-radius: 4px; }
about 4 years ago · Santiago Gelvez Report

0

esto debería ser una solución súper rápida:

Su nombre de clase debe coincidir con el nombre de la clase css .line-separator

 import "./styles.css"; export default function App() { const separator = { backgroundColor: "#E9E9E9", height: "12px", margin: "8px", borderRadius: "4px" }; return ( <div className="App"> <hr style={separator} /> <hr className="line-separator" /> </div> ); }

El valor de height aquí solo necesita cambiarse a 12px

 .line-separator { background-color: #e9e9e9; height: 12px; margin: 8px; border-radius: 4px; }
about 4 years ago · Santiago Gelvez 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!