Why are my text boxes and text areas not aligned when they are the same width?

Here's the simplest example:

<textarea id="text_area" name="text_area" style="width:280px">
</textarea>
<input id="text_field" name="text_field" style="width:280px" type="text" />

      

+2
css alignment textarea textfield


source to share


2 answers


Try setting padding and margin values ​​to 0px.



+3


source to share


I also needed to set the border property. Adding the following to both elements:




border:1px solid #ccc;

      

+2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics