[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Problem with <div>

Posted on 2005-04-22
Medium Priority
Last Modified: 2010-04-09

I am having two divs on my html page and I am dosplaying only
one at a time , hiding other using javascript but hidden
div is taking space on html page i.e. white space is displayed at its
space even if hidden.

is there any way out to display both divs one at a time without
displaying space occupied by hidden div.

Question by:suneet123
  • 2
LVL 30

Accepted Solution

GrandSchtroumpf earned 200 total points
ID: 13842602
you need to set the "display" to "none" instead of setting the visibility.
something like this:
elem.style.display = "none";
LVL 30

Expert Comment

ID: 13842688
oops, i forgot about telling you how to show it:
elem.style.display = "block";

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question