I have a button that is positioned at the top of the browser. I want to show a dropdown list when the user clicks or hovers over this button.
HTML
<div class="translator">
<div class="translate-btn">Translator</div>
<div class="translate-dropdown">
<select>
<option>Translate-1</option>
<option>Translate-2</option>
<option>Translate-3</option>
</select>
</div>
</div>
CSS
.translator {
position: absolute;
top: 0;
right: 10%;
z-index: 9999;
}
.translate-btn {
background-color: rgba(136, 121, 91, 0.8);
border-radius: 0 0 5px 5px;
color: #fff;
cursor: pointer;
font-size: 13px;
font-weight: bold;
padding: 4px 15px 5px;
text-align: center;
text-transform: uppercase;
}
With this HTML structure, I aim to display the "translate-dropdown" div when the user interacts with the "translate-btn," either by clicking on it or hovering over it.
I'm wondering if achieving this effect is possible using only CSS, or if I'll need to use jQuery for it.
If anyone has any insights or suggestions, I would greatly appreciate the help. Thank you!