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

203
Views
CSS externo para elementos SVG dentro de la etiqueta del objeto

Tengo un svg con muchos elementos rect dentro y se ha agregado a html usando la etiqueta de objeto. Necesito escribir css externo (solo para cambiar el color al pasar el mouse sobre los elementos rect) para todos los elementos rect. Capaz de lograr esto si escribo estilos dentro de svg. Pero, ¿cómo lograr lo mismo con css externo?

muestra.html

 <object class="svg" id="show-svg" data="sample.svg" type="image/svg+xml"/>

muestra.svg

 <svg> <style> rect:hover {stroke: red !important} </style> <g> <rect style=stroke:white width="82.020828" height="134.9375" x="13.229176" y="135.60417" /> <rect style=stroke:white width="82.020828" height="134.9375" x="13.229176" y="135.60417" /> </g> </svg>

Lo anterior tiene css escrito dentro de svg y funciona bien. Pero me gustaría lograr lo mismo escribiendo css externo fuera de svg, ¿cómo hacerlo?

about 4 years ago · Juan Pablo Isaza
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!