I am a beginner in html and css. I made two blocks on the site, a cap and a sidebar. placed them, but when they increase or decrease in scale, they leave. I would be very grateful for the help, how to make this happen?

PS: Unfortunately I can not add screenshots as this is my first question.

  • Where are they going to go then? - hender
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky
  • When you increase the scale, to the center of the page, and when you decrease, to the sides - Adonxx

1 answer 1

Careful handling of dimensions.

Most likely, magic combinations like margin: 10px with width: 96% give acceptable results only with certain ranges of screen width.

The idiot's favorite way of dealing with spaces between inline-block blocks can have the same effect. We must honestly remove spaces from the markup, and not crush the crutches. By the way, a special case of inline-blocks is the space between the pseudo-element and the element with vertical centering. Himself stepped on a rake when the transfer depended on the text in the nested block.