Skip to content

How to add svg icons to my project? #123339

Discussion options

You must be logged in to vote

Hi @brandnkay , this is one of the way how to implement it. I hope it will help:
HTML:

    <div class="container">
        <div class="input-icon">
            <input type="text" class="input-field">
            <svg class="arrow-icon" width="24" height="24">
                <!-- yout SVG icon for arrow -->
            </svg>
        </div>
        <svg class="cross-icon" width="24" height="24">
             <!-- yout SVG icon for cross -->
        </svg>
    </div>

And the css:

.container {
    position: relative;
    height: 150px; /* your height */
    width: 300px; /* your width */
}

.input-icon {
    position: relative;
}

.input-field {
    width: 100%;
    padding-left: 30px; /* …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@brandnkay
Comment options

Comment options

You must be logged in to vote
6 replies
@brandnkay
Comment options

@liker912
Comment options

@brandnkay
Comment options

@liker912
Comment options

@ebndev
Comment options

Answer selected by brandnkay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Programming Help Programming languages, open source, and software development.
4 participants