doucan9079 2015-11-20 14:40
浏览 14
已采纳

在表div下关闭div [关闭]

I've got a strange problem. I coded two pages that are a header (menu) and a slider. The header, in order to be centered, is displayed as a table, and the Slider as a block.

The problem i've got is that when I include with php my two divs (That are on separated files), the block div (slider) appear in front of the table div (menu) as you can see :

http://test.brunotarhan.fr/home(2).php

Code:

http://codepen.io/anon/pen/qOwNdz

<div id="bg">

<div id="menu">
<div class="table">
<ul>
  <li class="navitem"><a href="#">Portfolio</a>
  <ul>
      <li><a href="#">Logotypes</a></li>
      <li><a href="#">Mise en pages</a></li>
      <li><a href="#">Photographie</a></li>
      <li><a href="#">Autre...</a></li>
    </ul>
  </li>
  <li class="navitem"><a href="#">Projets</a>
  </li>
  <li id="logo"><a href="http://test.brunotarhan.fr/"><img src="http://test.brunotarhan.fr/img2015/LogoSite.png" width="268" height="190"></a></li>
  <li class="navitem"><a href="#">A propos</a></li>
  <li class="navitem"><a href="#">Contact</a></li>
</ul>
</div>
</div> <br>
<link rel="stylesheet" href="style2015.css" />

<div class="table" id="slider">
<ul>
      <li class="fg"></li>
      <li><a href="#"></a></li>
      <li class="fd"><a href="#"></a></li>

</ul>
</div></div>
  • 写回答

1条回答 默认 最新

  • douxian0279 2015-11-20 21:22
    关注

    The #menu div has a height of 30px. The table inside it has a bigger height, so it overflows out of the div, but that doesn't change the vertical position of the #slider div below. So the #slider div overlaps most of the table.

    Solution: don't give #menu a height of 30px.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致