I am facing with a problem that my top menu overlaps the body. When actually menu must be placed above body. I've already tried display: block; but it didn't help

Can you look trough it please ?

Here my Demo

有帮助吗?

解决方案

Okay, try this. Give the menu div

style="display:table;"

and hope it will solve your issue. Before it doesnot assume any space for div itself, but only for the content and the main div occupies the space right from the top.

Here is the fiddle. I have given there inline css. But I suggest to define a class for menu and put the css in there.

其他提示

Have you created a container div for the entire page? And then have a background div and a separate menu div?

<div id="page_container">
 <div id="background"> Background code
  <div id="menu">Menu code
  </div>
  <div id="body_content">Content in body code
  </div>
 </div>
</div>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top