I ran into a problem that I could not solve Google. I have static HTML:
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input class="search" type="text" placeholder="Search..." />
<ul class="results">
<li><a href="google.com">Google it</a>
</li>
</ul>
</body>
And css file:
.search:focus + .results { display: block; }
.results {
display:none;
}
It shows the ul element when I focus on the textBox, but when I try to click on the link, it just disappears. Please explain why this is happening.
source
share