z-index
свойство может делать то, что вы хотите от CSS.Я только что прокомментировал margin-left от css, чтобы продемонстрировать вам результат.Вы можете сохранить его как есть в вашем коде.
Запустите код ниже.Я надеюсь, что это решит вашу проблему с CSS.
header{
background-color: black;
width:100%;
height: 50px;
position: fixed;
z-index:20;
color: white;
}
.mainbox{
width: 800px;
height: 100%;
background-color: green;
position: absolute;
border: 1px solid lightgrey;
border-radius: 5px;
top: 55px;
left: 50%;
/**margin-left: -500px;*/
z-index:5;
}
<html>
<header class="header">
This header
</header>
<div class="mainbox">
Here will be list of questions by php
</div>
</html>