覆盖容器DIV [英] Overriding the container DIV

查看:136
本文介绍了覆盖容器DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个div,其中是另一个div.另一个div是一个下拉列表,仅在单击按钮时显示.现在,我的问题是,当我单击选择框时,它会覆盖div容器,并且其中尽可能多地显示在div容器中,而其余部分则显示为覆盖它.而在我的下拉div中,情况并非如此.如果它的高度大于容器的高度,则只显示容器的高度,其余的则显示在容器的后面.我希望它像选择框一样起作用. (以覆盖容器div).

Hello,

I have a div in which is another div. The other div is a dropdown, it is displayed only when a button is clicked. Now, my question is, when I click a select box, it overrides the div container, and as much of it displays inside it as much possible, and the rest is displayed covering it. Whereas, in my dropdown div, this isn''t the case. If it''s height is more than the height of container, only as much of it is displayed as much the height of the containe, the rest goes somewhere behind. I want it to act the way the select box does. (To override the container div).

How do I do that?

推荐答案

您可以使用CSS的溢出"属性来解决此问题...

you can solve this using css ''overflow'' atribute...

overflow:visible;

//未消除溢出.它在元素框的外部渲染.这是默认设置

//The overflow is not clipped. It renders outside the element''s box. This is default

overflow:scroll;

//剪辑了溢出,但添加了滚动条以查看其余内容

//The overflow is clipped, but a scroll-bar is added to see the rest of the content


这篇关于覆盖容器DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆