Skip to main content
visual_Dream5CAA
Known Participant
October 31, 2023
Answered

help to make icon in extension illustrator

  • October 31, 2023
  • 1 reply
  • 428 views

i try to add icon svg or png but same probleme i get lik this probleme the icon not showing:
my code html:

<div id="mainButtons">
    <button id="gridlines" class="iconButton gridlines-icon" onclick="selectButton(this)">
        <span>Gridlines</span>
    </button>
</div>
 
my code css:
/* Define a CSS class for the Gridlines button */
.gridlines-icon {
    /* Set the SVG file as a background image */
    background-image: url("Asset/SVG/gridlines.svg");
    /* Set the width and height of the element to match the SVG size */
    width: 24px;
    height: 24px;
    /* Optionally, set other styles like padding and background color */
    padding: 5px;
    background-color: transparent;
    /* Ensure the background image is centered and not repeated */
    background-position: center;
    background-repeat: no-repeat;
}
 
any help to resolve this probleme
This topic has been closed for replies.
Correct answer Sergey Osokin

Where do you have the Asset folder: in the root of the extension or in the subfolder with the CSS file? If in the root, you need to specify

background-image: url(../Asset/SVG/gridlines.svg);

1 reply

Sergey Osokin
Sergey OsokinCorrect answer
Inspiring
November 1, 2023

Where do you have the Asset folder: in the root of the extension or in the subfolder with the CSS file? If in the root, you need to specify

background-image: url(../Asset/SVG/gridlines.svg);
visual_Dream5CAA
Known Participant
November 1, 2023

thank you its working