I currently have a form that is hidden by default using display:none
. When I hover over another link, the form becomes visible. Is there a way to automatically place the cursor in the input field when this happens using CSS?
If I change the form's display property to inline-block
directly, the cursor is automatically placed in the input field.
This is my CSS:
.search-bar {
display: none;
}
#main-nav a:hover .search-bar {
display: inline-block;
}
This is the code for my Form in the HTML file:
<input id="search_search" type="text" autofocus="autofocus" placeholder="Placeholder.Search.Main" name="search[search]"></input>