Reputation: 4302
TL;DR click the link
My input elements are on strike and refuse to work. I've stripped this down to isolate the variables, and I've found a few things that fix the problem, but I know there's something else going on here...
HTML and CSS per SO guidelines:
<div class="fl half">
<div class="input-wrap">
<input />
</div>
<div class="input-wrap">
<input />
</div>
<div class="clear"></div>
</div>
<div class="fr half">
<div class="input-wrap">
<input />
</div>
<div class="input-wrap">
<input />
</div>
<div class="clear"></div>
</div>
<div class="input-wrap">
<select>
<option>Select</option>
</select>
</div>
CSS:
.fl { float: left; }
.fr { float: right; }
.half { width: 50%; }
input { border: 1px solid black; }
.input-wrap { margin-bottom: 14px; position: relative; }
.clear { clear: both; }
Upvotes: 5
Views: 18708
Reputation: 14191
In relation to the question: it is also worth noting that if you are trying to focus
on a not-natively focusable element, you can try to use the html attribute tabindex
to make it focusable.
Upvotes: 0
Reputation: 972
The .input-wrap div is overlapping the inputs. SO, when you click on the inputs, you are actually clicking .input-wrap which is over them.
The reason is that the .half divs that contain the inputs are floating.
Easy fix would be to add style clear:both
on you existing css add class 'clear' to .input-wrap div.
<div class="input-wrap clear">
<select>
<option>Select</option>
</select>
</div>
See http://jsfiddle.net/mafUh/1/
Upvotes: 6
Reputation: 4302
Adding position: relative; z-index: 1;
to the input {}
rule seemed to work, thanks to Musa's suggestion.
However, this doesn't seem like the best solution, can you not have input elements inside position: relative???
Ignoring this solution, I'm still looking for a better answer. This seems like a bug... Why would removing the select element, or removing the floats, effect the z-index of the inputs/wrap?
Upvotes: 3
Reputation: 97672
Your div .input-wrap is over the input, removing position: relative seems to put it behind the inputs.
.input-wrap { margin-bottom: 14px; }
Upvotes: 1