I have an input element that width is 20% and I want to center it horizontally. I have tried text-align center (parent element), but it didn’t help. Here how it looks (the input box):

now the element code is like this:
<fieldset class="ui-grid-solo" style="text-align:center !important;">
<input type="number" class="answerIput"/>
</fieldset>
Is there any way to do this?
Just add
margin: 0 autoto the element. With a fixed-width block element, automatic left/right margins will center it relative to the parent: