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

238
Views
¿Cómo copiar texto sin perder su estilo?

La copia de texto general simplemente copia el texto sin dar ninguna importancia a los estilos. ¿Hay alguna forma de copiar texto sin perder sus propiedades inherentes, como la familia de fuentes, el tamaño de fuente, etc. Una función de javascript sería útil? Gracias.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Teniendo el elemento correcto seleccionado en el árbol HTML DOM, haga clic derecho sobre él y seleccione "Copiar" > "Copiar estilos".

Fuente: https://getcssscan.com/blog/how-to-inspect-copy-element-css

about 4 years ago · Santiago Trujillo Report

0

Puede usar Clipboard.write() con partes de texto y html:

Parque infantil TS

 // This will return the raw HTML, but perhaps you want to do something different, // for example: recursively embed computed styles: // https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle function serializeElement (element: Element): string { return element.outerHTML; } async function copyTextWithStyles (element: Element): Promise<void> { const html = serializeElement(element); const htmlBlob = new Blob([html], {type: 'text/html'}); const text = element.textContent ?? ''; const textBlob = new Blob([text], {type: 'text/plain'}); const clipboardItem = new ClipboardItem({ [htmlBlob.type]: htmlBlob, [textBlob.type]: textBlob, }); return navigator.clipboard.write([clipboardItem]); }
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!