使一个div可见,另一个不可见 [英] Make one div visible and another invisible

查看:150
本文介绍了使一个div可见,另一个不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个div标签,一个用于搜索,另一个用于搜索结果。我需要的是,当点击提交按钮时,结果被返回并放入结果div(带有iframe),搜索div应该隐藏,结果div应该可见。



搜索div初始设置为可见(使用可见性),结果div最初设置为隐藏(使用隐藏的可见性)。

此外,最初它是隐藏div的页面底部的一个巨大的空白区域,所以我如何确保底部没有额外的空白区域。

解决方案

通过可见性使其不可见仍然会占用空间。请尝试将显示设置为none,以使其不显示,然后将显示设置为阻止显示。


I have two div tags, one is for the search and the other is for the results. What I need is for when the submit button is clicked the results are returned and placed into the results div (with an iframe) and the search div should become hidden and the results div should be made visible.

search div is initially set to visible (using the visibility to visible) and the results div is initially set to hidden (using the visibility to hidden).

Also, initially ther eis a huge white space at the bottom of the page where the hidden div is, so how do I make sure there is no extra white space at the bottom too.

解决方案

Making it invisible with visibility still makes it use up space. Rather try set the display to none to make it invisible, and then set the display to block to make it visible.

这篇关于使一个div可见,另一个不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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