E
E
Evgenij_nechujveter2018-03-14 15:51:25
css
Evgenij_nechujveter, 2018-03-14 15:51:25

Why is the text on the side and not at the top of the image?

Why is the text on the side and not at the top of the image?
Here is the code:

<div class="wrapper">
<a href="https://granitrus.ru/pamyatniki-na-mogilu">Памятники</a>
</div>
<div class="wrapper">
<img src="images/1/pamatniki.jpg">
</div>

CSS has written like this:
.wrapper {
float: left;
}
Now the picture looks like this:
5aa91b2dec8ca067739354.png
We want the text to be on top of the picture, not on the side. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita, 2018-03-14
@Rema1ns

put the link in the div

O
Oleg Komenda, 2018-03-14
@rafamont

It's hard to say without the code, try putting the link in a container with a picture, and give the link this code

position: absolute;
top: 0;
left: 0;

B
bugagashnik, 2018-03-14
@bugagashnik

Does the common div in which the divs (wrapper) are located have some style? Because of him, it could be more likely. Divas should by default go with a reset to the next line. Or try writing the following for the parent div of both wrappers:

display:flex;
flex-direction:column;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question