html - Input Fields Do Not Resize Properly with Browser -
ok, when resizing browser input fields not resize , overlap each other in middle , distorted before media script kicks in , sets 100%. text area width 100% not line forms. dealing contact form has been exhausting, , haven't tried figure out how send email yet lol...
bonus question: why input have wrapped in span or ignores parent divs boundaries??
per request, here jsfiddle script. https://jsfiddle.net/lxlux35m/1/
.block { width: 100%; background-color: #edeeef; padding: 50px 0; } .block:nth-of-type(odd) { background-color: #ffffff; } .block:after { content: ''; display: block; clear: both; overflow: hidden; zoom: 1; height: 0; } .blockwrapper { text-align: center; max-width: 60%; margin: 0 auto; } .blocksizer1, .blocksizer2, .blocksizer3 { float: left; text-align: left; } .blocksizer1 { width: 100%; } .blocksizer2 { width: 49%; } .blocksizer3 { width: 33%; } #contactform { padding: 5px; } #contactform span { width: 49%; padding: 5px 0 0 0; display: inline-block; } #contactform > .textarea { width: 100%; } #contactform > .textarea textarea { width: 98%; min-height: 200px; margin: 1em 0 1em 0em; } #contactform input { width: 92%; color: #999999; outline: none; padding: 10px; border: 1px solid #a0a0a0; } .contactformbutton, .contactformbutton input { width: 100% !important; } @media screen , (max-width: 1000px) { div.contactform, div.contactformright { width: 100%; margin: 5px 0; float: none; padding: 0; } } textarea.contactform { width: 100%; padding: 10px; min-height: 200px; }
<div class="block"> <div class="blockwrapper"> <div class="blocksizer2"> <form id="contactform" action="#" method="post"> <h1>contact me</h1> <p>lorem ipsum primis in faucibus. praesent faucibus massa elit, vitae ultrices libero dapibus nec. maecenas cursus rutrum odio ut convallis. curabitur viverra est in diam tincidunt, nec tincidunt tortor dapibus.</p> <span><input type="text" name="name" placeholder="name" required="" /></span> <span class="contactformright"><input class="" type="text" name="subject" placeholder="company name" required="" /></span> <span><input type="email" name="email" placeholder="email" required="" /></span> <span class="contactformright"><input type="text" name="phone" placeholder="phone" required="" /></span> <span class="textarea"><textarea name="message" placeholder="message..." required></textarea></span> <span class="contactformbutton"><input type="submit" value="submit"></span> </form> </div> <div class="blocksizer2"> </div> </div> </div>
check code update media query
<style> .block { width: 100%; background-color: #edeeef; padding: 50px 0; } .block:nth-of-type(odd) { background-color: #ffffff; } .block:after { content: ''; display: block; clear: both; overflow: hidden; zoom: 1; height: 0; } .blockwrapper { text-align: center; max-width: 60%; margin: 0 auto; } .blocksizer1, .blocksizer2, .blocksizer3 { float: left; text-align: left; } .blocksizer1 { width: 100%; } .blocksizer2 { width: 49%; } .blocksizer3 { width: 33%; } #contactform { padding: 5px; } #contactform span { width: 49%; padding: 5px 0 0 0; display: inline-block; } #contactform > .textarea { width: 100%; } #contactform > .textarea textarea { width: 98%; min-height: 200px; margin: 1em 0 1em 0em; } #contactform input { width: 98%; color: #999999; outline: none; padding: 10px; border: 1px solid #a0a0a0; } .contactformbutton, .contactformbutton input { width: 100% !important; } textarea.contactform { width: 100%; padding: 10px; min-height: 200px; } @media screen , (max-width: 1000px) { div.contactform, div.contactformright { width: 100%; margin: 5px 0; float: none; padding: 0; } .blockwrapper { width: 100%; } .blocksizer2 { width: 100%; } #contactform span { width: 100%; padding: 5px 0 0 0; display: inline-block; } } </style>
<div class="block"> <div class="blockwrapper"> <div class="blocksizer2"> <form id="contactform" action="#" method="post"> <h1>contact me</h1> <p>lorem ipsum primis in faucibus. praesent faucibus massa elit, vitae ultrices libero dapibus nec. maecenas cursus rutrum odio ut convallis. curabitur viverra est in diam tincidunt, nec tincidunt tortor dapibus.</p> <span><input type="text" name="name" placeholder="name" required=""/></span> <span class="contactformright"><input class="" type="text" name="subject" placeholder="company name" required=""/></span> <span><input type="email" name="email" placeholder="email" required=""/></span> <span class="contactformright"><input type="text" name="phone" placeholder="phone" required=""/></span> <span class="textarea"><textarea name="message" placeholder="message..." required></textarea></span> <span class="contactformbutton"><input type="submit" value="submit"></span> </form> </div> <div class="blocksizer2"> </div> </div> </div>
Comments
Post a Comment