M
M
miron44444ik2021-07-20 19:11:20
css
miron44444ik, 2021-07-20 19:11:20

How to place text over an image?

https://jsfiddle.net/artmir/09dvg3s1/3/
Here is my code. How to make the text be a little higher and not climb into the area marked with a red rectangle (see screenshot), that is, it should be a little higher, but the height of the .slider should be 100vh and the text should be inside the image.
60f6f58448e7c918549919.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
karmyskove, 2021-07-20
@karmyskove

For .slider, add these properties:

display: flex;
justify-content: center;

The image in the center will rise.
To make the text look like in the image, you need to set the title class property: max-width: 550px;
Here is the codepen link: https://codepen.io/EugeneKarmyshkov/pen/wvdqPez

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question