There is a frame, I want to make it a background in the center, and place blocks in it.
The problem is that as soon as I did not try, if I line up elements relative to it, then when the page scale changes, the elements move beyond the frame. If you position them through the CSS position properties, then problems with center alignment begin.
Here is the frame (filled it with color, dimensions like that of the current one), which I use as a background image with properties
background-position: center; background-repeat: no-repeat;"> But the element that I want to place in it, indented from the top edge of the frame, and centered on the width of the frame.
How can it be placed inside the frame so that when scrolling / zooming it is tied to the frame?
<html> <head> <style type="text/css"> .parent { background-image: url(bg.png); background-position: center; background-repeat: no-repeat; width: 100%; height: 100%; margin: 0 auto; position: relative; } .child{ width: 100%; height: 100%; position: absolute; top: 25%; left: 10%; } </style> </head> <body bgcolor="#000000"> <div class="parent"> <div class="child"><img src="logo.png"></div> </div> </body> </html> 
