V
V
Vald3r2019-01-03 14:36:39
css
Vald3r, 2019-01-03 14:36:39

Svg not connecting?

you need to place a svg search icon on the left side of the placeholder, changing opacity and color depending on the state (hover, active, etc.)
https://codepen.io/Vald3r/pen/EGQPyQ
Everything was registered in the buttons without problems ¯\_ (ツ)_/¯
5c2df38706c02377120238.png
should be like this:
5c2df419ce9c4848111808.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vald3r, 2019-01-13
@Vald3r

in general, I set the icon as a background > added 2 svg files (for the hover and focus states), inside the files, through fill and fill-opacity, I prescribed the desired icon colors
5c3b1131e1801134230544.png

M
monochromer, 2019-01-03
@monochromer

It is not correct to set ::before and ::after pseudo-elements for input. Either make the icon the background of the input, or wrap the input in a wrapper element and position the icon relative to the wrapper.

P
Pashchuk Ilya, 2019-01-03
@IlyaDeveloper

Of course, it will not work, because input is a single tag, roughly, it does not have a closure, you cannot place a pseudo-element in it, so do it like this

.input
    i.icon-search
    input.input__field(type="text" placeholder="search")

Well, or just hang the pseudo-class already on .input
By the way, such a small hack, if your icon is just the size you need, then you can display it like this
.input:before {
  content: url("../img/sprites/icon-search.svg");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question