Jump to content

style.display = "none"; hides content, but it still takes up space


AARRGGHHH

Recommended Posts


			function hideElements()  {											
				document.getElementById('div1').style.display = "block"; 
				document.getElementById('div2').style.display = "none"; 
				document.getElementById('div3').style.display = "none"; 
				document.getElementById('div4').style.display = "none"; 	
				document.getElementById('div5').style.display = "none"; 		
				hideScreenElements(); }

How do I get the div that I'm hiding to stop taking up space when style.display = none?  It's throwing off the vertical placement of a video beneath the divs that are set to none. 

Thank you 

 

Link to comment
Share on other sites

On Windows, most browsers use the F12 key to open the element inspector. You can also find it by right-clicking anywhere on a page and selecting "Inspect" from the context menu.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...