I'm having trouble getting my CSS to work :(
HTML
<form action="/api/submit/" method="post">
<textarea name="post" rows="2"></textarea>
<input type="url" name="url" />
<div>
<input type="radio" name="someName" value="someValue" />
</div>
<button type="submit">Submit</button>
</form>
CSS
form > input {
display: none;
position: absolute; top: -2.5em; left: 0;
}
form > textarea:focus + input {
display: block;
}
form > div {
display: none;
position: absolute; top: 0; left: -6.66%;
}
form > textarea:focus + input + div {
display: block;
}
What I want is to have the div and the input elements to appear when the textarea is in focus. At the moment, only the input element is doing what its supposed to do.
Also, I can select the div if I don't use :focus on the textarea, which is strange.