How to add icon to the right using :before?


If the user input is not good enough for this server, you need to display it. And now, I realized! Yay!

<small className="error-message">{errors.password}</small>

 content: ""
 display: block
 background: url("./warning.svg") no-repeat
 width: 17px
 height: 17px
 float: left
 margin-right: .4em

 color: #de071c

 margin-bottom: .8em

But there is one problemka... See what's happening on mobile screens.


How to put this icon to small?

Help solve the problem, please.
March 19th 20 at 08:41
3 answers
March 19th 20 at 08:43
 position: relative;
 padding-right: 20px;
 position: absolute
 top: 50%;
 right: 0;
 transform: translateY(-50%);
March 19th 20 at 08:45
can you read, for example:
&:after {
 display: inline-block;
March 19th 20 at 08:47

Find more questions by tags CSS