html - 缩小页面时不可点击的元素

标签 html css twitter-bootstrap dom css-position

我的退出页面元素有问题。我在页面右侧创建了一个大“X”。这是用于退出当前内容的可点击元素。

这个元素有一个代码:

.section-modal .close-modal {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 75px;
    height: 75px;
    background-color: transparent;
    cursor: pointer;
}

.section-modal .close-modal:hover {
    opacity: .3;
}

.section-modal .close-modal .lr {
    z-index: 1051;
    width: 5px;
    height: 75px;
    margin-left: 35px;
    background-color: #222;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.section-modal .close-modal .lr .rl {
    z-index: 1052;
    width: 5px;
    height: 75px;
    background-color: #222;
    -webkit-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
}

我在页面的顶部中间有一个 Logo 图像。这是一个代码:

     <div class="close-modal" data-dismiss="modal">
       <div class="lr">
         <div class="rl">

         </div>
        </div>
      </div>

      <div class="container">
        <div class="row">
           <div class="col-md-12 col-sm-12">
              <img src="img\Logo2.png" class="img-responsive" style="margin: 0 auto; z-index: -1" alt="...">

当我缩小页面时,我的 Logo 附近有一个“X”,但我无法单击并返回主页。我无法解决此解决方案。请帮忙。

如果您需要更多信息,请告诉我,我将编辑一个问题。

最佳答案

很难从您的代码中分辨出来,但我猜问题出在 Logo 与“x”按钮重叠。为了确定,请右键单击“x”并选择“检查元素”。

如果打开的元素选项卡集中在 img 标签上而不是 'x' 那就是你的问题。要解决它,请给它一个 z-index:

.section-modal .close-modal {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 75px;
    height: 75px;
    background-color: transparent;
    cursor: pointer;
    z-index: 100
}

关于html - 缩小页面时不可点击的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37511244/

相关文章:

javascript - 动态添加事件到 div

javascript - 如果两个选项相同,则在第二次选择时转到下一个选项

html body 高度问题

jquery - 如果使用 jquery 的 div 长度大于一个,则删除 div 元素?

javascript - 将 chatango 添加到 Bootstrap 问题

html - 列采用 Bootstrap 中最小设备的大小

javascript - 如何对现有列表项使用 CSS 转换来为新列表项腾出空间?

html - 在列中均匀分布按钮(元素)

css - 如何自定义 material-ui Accordion 组件的行为/样式?

html - HTML 中的 Bootstrap col-xs-12 未占用全宽