html - Why can't I select inside these input boxes? -
i'm building dummy form in codepen , in middle row wanted have 2 input boxes next each other taking 50% each in row. able this, however, cannot click inside either input box start typing. way can start typing in each input start @ first box , press 'tab'. suggestions?
html:
<div class="wrapper"> <h1>application philadelphia eagles</h1> <h2><strong>position:</strong> wide receiver</h2> <p>an attempt @ input label floats</p> <form class="form-container"> <div class="form-tr"> <div class="tc-100"><input type="text"></div> </div> <div class="form-tr"> <div class="tc-50 flt-l"><input type="text"></div> <div class="tc-50 flt-r"><input type="text"></div> </div> <div class="form-tr"> <div class="tc-100"><input type="text"></div> </div> </form> </div>
css:
@import url('https://fonts.googleapis.com/css?family=josefin+slab:400,300,700'); body { font-family: josefin slab, sans-serif; } h1, h2 {margin: 0.465em} .wrapper { margin: 0 auto; text-align: center; width: 75%; } .flt-l { float:left; } .flt-r { float:right; } .form-container { position:relative; border: 1px solid #000; width:40em; margin: 0 auto; } .form-tr { display: block; position:relative; margin-bottom: 0px; width:100%; } .tc-50 { width:50%; } input[type=text] { width: 100%; } input[type=text] { font-size:1em; padding:1em; box-sizing: border-box; }
my codepen here: http://codepen.io/mjdeangelis/pen/avpbex?editors=110
another fix removing position:relative property form-tr on css file since outer form container has , in case making 2 inputs in middle overlap.
before:
.form-tr { display: block; position:relative; margin-bottom: 0px; width:100%; }
after:
.form-tr { display: block; margin-bottom: 0px; width:100%; }
for references can check out following links:
http://www.w3schools.com/cssref/playit.asp?filename=playcss_position http://www.w3schools.com/cssref/pr_class_position.asp
Comments
Post a Comment