按钮未在固定位置DIV内部单击?

时间:2015-10-27 07:54:49

标签: javascript jquery html css css3

由于页脚的固定位置div,我面临一些问题。

页脚栏css样式如下所示:

.footerbar{
padding-bottom: 3px;
    background-color: #05A3AD;
    bottom: 100px;
    height: 45px;
    left: 0px;
    position: fixed !important;
    text-align: center;
    width: 100%;
    z-index: 101;
}

问题是,当按钮放在固定div内部时没有点击。 仅供参考,按钮是可点击的,或仅在具有上述风格的IE上工作,不适用于任何其他浏览器。

即。)

<div class="footerbar">
    <input type='button' id='somebtn'/>
</div>

somebtn没有点击固定div内部。当我移除固定位置并将底部从100px更改为0px时,按钮正在单击并且工作正常。

我在这一点上挣扎。 请就此问题向我提出建议。提前谢谢。

2 个答案:

答案 0 :(得分:2)

工作正常,

  • 您需要正确关闭div,使用"/"关闭div并
  • 从HTML代码中移除"."(点),即。<div class=".footerbar">

CSS:

 <div class="footerbar">
        <input type='button' id='somebtn' />
  </div>

<强> Demo

答案 1 :(得分:1)

在此fiddle中完美无缺。刚刚将类名从“.footerbar”更改为“footerbar”并正确关闭div!

Add This CSS

#inner {
    background-color: yellow;
    margin-left: 50px;
    margin-bottom: 50px;
    display: inline-block;
}
相关问题