x

Dropdown Coding - Will not collapse!

Afternoon everyone!

Just need a little bit of help with some coding. (And realised I've probably posted this in the wrong forums...)

Trying to create a dropdown directory list of photo galleries, which only appears on Mobile devices (Thanks Hide!)

The list contains links that take you to the relevant page with the photos.

However, I cannot get it to collapse once you press it to open.

The webpage is as follows: - In order to view the button, you must view it on a "Medium or Small" screen.

http://marleys2019.weebly.com/photo-gallery.html

The code I'm using is as follows;

<style>
.wcustomhtml
{
overflow: visible !important;
}
.dropbtn {
background-color: #a1a1a1;
color: white;
min-width: 250px;
padding: 16px;
font-size: 16px;
border: none;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 250px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {background-color: #ddd;}
.dropdown:hover .dropdown-content {display: block;}
.dropdown:hover .dropbtn {background-color: a1a1c1;}
</style>
<div class="dropdown">
<button class="dropbtn">Photo Galleries</button>
<div class="dropdown-content">
<a href="http://marleys2019.weebly.com/new-truck.html">Truck Fitout</a>
<a href="http://marleys2019.weebly.com/2009-christmas.html">09 Xmas Party</a>
<a href="http://marleys2019.weebly.com/40-years.html">40Yrs Surprise</a>
<a href="http://marleys2019.weebly.com/hope-valley-opening.html">Hope Valley Opening</a>
</div>
</div>

Can anyone please help me with what I'm missing?! I just need it to collapse when you press it again.

Many thanks in advance!

970 Views
Message 1 of 3
Report
1 Best Answer

Best Answer

This has been resolved on another thread, didnt realise I'd posted this twice!

View Best Answer >

896 Views
Message 2 of 3
Report
2 REPLIES 2

Best Answer

This has been resolved on another thread, didnt realise I'd posted this twice!

897 Views
Message 2 of 3
Report
Square

Awesome. Thanks for updating us. Smiley Happy 

886 Views
Message 2 of 3
Report