I'd like to make this form's select
list automatically drop down on a hover, just like the menu for the "Layout..." button automatically drops down, using only HTML and CSS. I've tried copying the button's CSS tricks to the option list without success. Can it be done?
.dropdown-content {
display: none; /* don't drop down until time to show */
position: absolute; /* keep button in-place */
background-color: white; /* so items aren't see-through */
border: 1px solid; /* dropdown outline */
}
.dropdown-content a { /* links inside the dropdown */
text-decoration: none; /* avoid underlining */
display: block; /* put each link on a line */
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover { background-color: rgb(200,235,255); }
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content { display: block }
<div class="dropdown"><button class="dropbtn">Layout...</button>
<div class="dropdown-content">
<a href="small.html">Small</a>
<a href="medium.html">Medium</a>
<a href="large.html">Large</a>
</div>
</div>
<p>
<form action="action.dll" method="GET">
<input class="forminput" type="submit" value="Find:"> <input type="text" name="target" value=""> in
<select name="field" id="field">
<option value = "Field1">Field1</option>
<option value = "Field2">Field2</option>
<option value = "Field3">Field3</option>
</select>
</form>