无法将溢出Y覆盖为可见

时间:2019-12-24 14:32:13

标签: html css

enter image description here

我在一个CSS主文件中将overflow-y设置为scroll,我用移动版本的另一个CSS部分覆盖了该文件。

第一个主CSS文件具有:

div.container-left {
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
}

然后在第二个CSS文件中部分覆盖我拥有的一些属性

div.container-left {
  max-height: none;
  overflow-y: visible !important;
  overflow-x: hidden;
}

进口如下:

<link type="text/css" rel="stylesheet" href="<?php echo $href_root; ?>css/main-styles.css">
<link type="text/css" rel="stylesheet" href="<?php echo ($ismobile ? $href_root . 'css/main-styles-mobile.css' : '') ?>">

但是它不起作用。它仍然被剪辑并显示滚动条。预期和期望的行为是使内容不使用overflow-y: visible进行裁剪,但是显然将其设置为visible无效。

编辑:如果我从主css文件中同时删除了overflow-x: hidden;overflow-y: scroll;,那么它将尊重第二个导入文件中的overflow-y: visible;。这意味着CSS中存在一个错误,为什么它不使用{visible来覆盖overflow-y,特别是它甚至出现在计算出的值中?

0 个答案:

没有答案
相关问题