Click here to Skip to main content
15,888,162 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is using a drop down navigation menu. The following code does not work, but gives an idea of what im doing.

HTML
HTML
<!--Show/Hide NavMenu-->
<input id="ShowHideNavButton" type="image" src="/images/navIcons/mc-homeIcon.png" alt="ShowNav">


CSS
CSS
#ShowHideNavButton{
		display: block;
		width: 100px;
		height: 100px;
	}
	
	#navMenu:target {
  		display: block;
	}
    #navMenu{
		width: 150px;
		text-align: center;
		display: none;
	}


What should happen is, I press on the image, the nav div shows, and the opposite when I press again. can anyone please help with this?

What I have tried:

I have tried these following sites
http://stackoverflow.com/questions/17731457/hide-show-content-list-with-only-css-no-javascript-used

http://cssdeck.com/labs/css-only-showhide

https://alexcican.com/post/hide-and-show-div/
Posted
Comments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900