溢出的相对父母所涵盖的绝对孩子:auto

时间:2016-04-01 01:09:25

标签: html css

我有一个Student可搜索的输入框,可以使用angularJs指令生成一个下拉列表。

<input type="text" ng-model="searchString" />
<span class="results-container" ng-show="showContainer">
    <span ng-if="results.length > 0" class="result-row" ng-repeat="result in results" ng-click="assign(result)">
        {{result.Name}}
    </span>
</span>

正如你在这里看到的,弹出的主体(相对,溢出:auto)覆盖结果容器(绝对)。

enter image description here

如果我从父级中移除溢出:自动,它看起来就像我想要的那样。但是我不想删除溢出,因为对话框是通用的,其最大高度必须是可滚动的。

enter image description here

我认为这是可以实现的,因为本机选择不会被其父级覆盖 overflow:auto 就好了。像这样:

enter image description here

此外,我不能使用的一种可能的解决方案是将结果容器放在输入容器之外。我使用angular指令编写这个,你可以在其他页面上有多个这些可搜索的输入。将它们移到外面会破坏一切。有没有css专家帮忙?

0 个答案:

没有答案
相关问题