I have encountered an issue with some code that I wrote. When utilizing -webkit-center
and entering text into a textbox
, all the items shift to the right. I have attempted other -webkit
alignment settings without any problems, only -webkit-center
seems to be causing this issue. I have researched extensively but have been unable to find a solution. Can someone please explain why this is happening?
Below is the code for reference:
<div id="mainDiv" style="text-align: -webkit-center; display: inline-grid; margin-left: 40%;border-style:double;">
<span>HEADER</span>
<input name="header" type="text" id="header" style="margin: 20px;width:173px;">
<span>CONTENT</span>
<input name="content" type="text" id="content" style="margin: 20px;height:50px;width:350px;">
<span>HEADER COLOR</span>
<input name="headColor" type="text" id="headColor" style="margin: 20px;width:173px;">
<span>CONTENT COLOR</span>
<input name="contColor" type="text" id="contColor" style="margin: 20px;width:173px;">
<input type="submit" name="button" value="SUBMIT" id="button" style="height: 30px;width:173px;margin:20px;">
</div>