M
M
MRcracker2018-03-26 16:35:35
css
MRcracker, 2018-03-26 16:35:35

How to prevent blocks from sticking?

There are three blocks. First hat. The second block contains the properties position: absolute. The third block starts sticking to the second one during layout due to position: absolute. Tell me how to fix this? I use bootstrap-4 for layout. Perhaps there are some cash registers there))))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-03-26
@Stalker_RED

absolute
Do not leave space for the element. Instead, position it at a specified position relative to its closest positioned ancestor if any, or otherwise relative to the initial containing block. Absolutely positioned boxes can have margins, and they do not collapse with any other margins.

position: absolute removes the block from the flow.
It’s hard to tell how to remake, because you didn’t show what exactly is going on with you and what you want to achieve.

D
danilstep, 2018-03-26
@danilstep

Try experimenting with padding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question