简体   繁体   English

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

[英]Button not clicking inside Fixed position DIV?

I am facing some issues due to the fixed position div at the footer. 由于页脚位置固定,我遇到了一些问题。

The footer bar css styles is shown below: 页脚栏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;
}

The issue is, button is not clicking when it is placed inside of fixed div. 问题是,将按钮置于固定div内时未单击按钮。 FYI, the button is clickable or working only at IE with the above style and not working at any other browsers. 仅供参考,该按钮是可单击的,或者仅在具有上述样式的IE上有效,而在任何其他浏览器上均无效。

ie)

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

The somebtn is not clicking inside of fixed div. somebtn不在固定div内单击。 When I removed the fixed position and changed the bottom from 100px to 0px, the button is clicking and works fine. 当我删除固定位置并将底部从100px更改为0px时,该按钮正在单击并且可以正常工作。

I'm struggling at this point. 在这一点上我很挣扎。 Kindly advice me on the issue. 请就这个问题向我提出建议。 Thanks in advance. 提前致谢。

Its working fine, 工作正常,

  • You need to close the div properly, use "/" to close the div and 您需要正确关闭div ,使用"/"关闭div,然后
  • Remove "." 删除"." (dot) from HTML code ie., <div class=".footerbar"> (点)来自HTML代码,即<div class=".footerbar">

CSS: CSS:

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

Demo 演示版

Works perfectly fine in this fiddle . 在这个小提琴中工作得很好。 Just changed the class name from ".footerbar" to "footerbar" and close the div properly! 只需将类名从“ .footerbar”更改为“ footerbar”,然后正确关闭div!

<div class="footerbar">
<input type='button' id='somebtn' value="some button"/>
</div> //this needs to be corrected!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM