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

288
Views
el color de relleno svg no funciona con colores hexadecimales

Intentando crear un patrón de fondo svg, pero:

Cuando no estoy usando relleno, está bien, cuando uso un nombre de color como: color: red; está bien, pero si usa colores hexadecimales, no aparece nada.

aquí están los códigos:

OK:

 background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='10' ><path fill='red' d='M 0,10 H 20 L 10,0 Z' /></svg>") repeat-x;

NO ESTÁ BIEN:

 background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='10' ><path fill='#FF0000' d='M 0,10 H 20 L 10,0 Z' /></svg>") repeat-x;

también echa un vistazo a jsfiddle:

https://jsfiddle.net/vajnabotond/r362xdjn/19/

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

# en las URL inicia un identificador de fragmento. Entonces, para que eso funcione, escriba %23 en lugar de # . Ese es el valor del carácter # escapado.

 background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='10' ><path fill='%23FF0000' d='M 0,10 H 20 L 10,0 Z' /></svg>") repeat-x;

Puedes encontrarlo todo bien explicado en el siguiente enlace: https://codepen.io/gunnarbittersmann/pen/BoovjR

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