A
A
Andrey Shirokikh2019-05-16 17:38:12
css
Andrey Shirokikh, 2019-05-16 17:38:12

How to make an adaptive block inside another one?

Hello!
How to write a responsive design for two blocks (divs), one inside the other, so that when the size of the browser window (black square) inside the red block decreases, the brown one remains in place and does not move?
For example, if the red block is the slider on which I want to place the animation, but so that this animation block is only in 1 strict place.
Thank you all in advance!
5cdd750cd4828053151396.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Koryakin, 2019-05-16
@BlackerAndrew

.red{ /* красный блок */
  position: relative;
}

.brown{ /* коричныевый блок */
  position: absolute;
}

P
ParaBellum577, 2019-05-16
@ParaBellum577

Eugene is correct. And position the brown with top, left etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question