嵌套在div中的div不可点击

时间:2017-07-17 12:32:24

标签: html css

我有一个通知css。不幸的是,有一个通知的包装体。

此包装始终显示在所有页面上,但如果通知已关闭,则该块处于活动状态,无法单击该站点上的任何内容。

private void PropertyGrid_PreparePropertyItem(object sender, Xceed.Wpf.Toolkit.PropertyGrid.PropertyItemEventArgs e)
{
    YourViewModel vm = PropertyGrid.DataContext as YourViewModel;
    if (vm != null)
        vm.PreparePropertyCommand.Execute(null);
}

我无法找到一个更好的解决方案来包装整个宽度和响应的div,只有宽度和高度设置为100%。

我需要全宽和高度,因为在.notice-wrap { display: block; position: fixed; top: 0px; z-index: 9999; width: 100%; height: 100%; } 我有.notice-wrap的一个div .notice-item-wrapper

但如果background-color: rgba(0, 0, 0, 0.50);不是全宽和高,则bg颜色也不是全宽。

如何点击另一个div下面的div?

我为.notice-wrap尝试display:inline-block,但它无效。

2 个答案:

答案 0 :(得分:1)

没有看到代码。将您的身高更改为通知div的高度。例如:height:90px。你基本上创建了一个完整的高度和全宽度的div,由于你的z-index,它位于所有的顶部,这将使得下面的所有东西都无法点击。

答案 1 :(得分:0)

我认为将每个页面与整页div重叠并不是一个好主意,但在其样式中添加pointer-events: none将使其下方的元素可以点击。

这不适用于IE< 11

.notice-wrap {
   pointer-events: none;
   display: block;
   position: fixed;
   top: 0px;
   z-index: 9999;
   width: 100%;
   height: 100%;
}