question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pasting HTML code gives different results than pasting SVG.

See original GitHub issue

As an example, I’ll use this icon: https://tabler-icons.io/i/plus

This is the template I used:

<button class="btn btn-primary">
<!-- here goes the code -->
Example button
</button>

Code:

<i class="ti ti-plus"></i>

Result: obraz

Code:

<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-plus" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
   <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
   <line x1="12" y1="5" x2="12" y2="19"></line>
   <line x1="5" y1="12" x2="19" y2="12"></line>
</svg>

Result: obraz

Is it possible to have the same results with webfont/CSS as with SVG?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
codecalmcommented, Oct 7, 2022

@dekoza try to add icon class to <i> element

0reactions
dekozacommented, Oct 7, 2022

I needed to add me-2 class. There has to be a better way 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to eliminate HTML code duplication when using the ...
I'm just looking for a way to include this SVG in four separate locations without copying and pasting the duplicate code in each...
Read more >
The Best Way to Embed SVG on HTML (2021) - Vecta.io
What's the best way to embed SVGs in HTML 5? How does embedding SVGs using Img tags, Object tags, Inline SVG differs among...
Read more >
SVG HTML code does not copy with copy/paste function - Bugs
SOLVED: SVG HTML code does not copy with copy/paste function ... OS: Windows, chrome, lastest. ... Soo, not sure if intentional or not...
Read more >
Using SVG | CSS-Tricks
SVG is an image format for vector graphics. It literally means Scalable Vector Graphics. Basically, what you work with in Adobe Illustrator.
Read more >
SVG files: what are they and how to use them? - Webflow
4 benefits of using SVG files in web design. SVGs and other vector graphics are fundamentally different from raster graphics, such as jpegs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found