I
I
Ivan2020-05-06 06:44:39
css
Ivan, 2020-05-06 06:44:39

How to make an element follow another element?

For example, there is a link: And there is a picture in the form of an arrow: You need to make sure that wherever the block moves, this picture follows it. How to do it?

<a class="mylink">Ссылка</a>


<img src="#" class="arrow">

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maxwellw0w01, 2020-05-06
@maxwellw0w01

position: fixed for help.)
Anchors the element to a specific point on the screen and does not change its position when the page is scrolled.

T
topalek, 2020-05-06
@topalek

just add pseudo-class ::after to class "mylink";

.mylink::after{
display:inline-block;
content:'';
width: 10px;
height: 5px;
background: url('ПУТЬ К ТВОЕЙ КАРТИНКЕ') no-repeat;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question