对于所有默认输入,您填写的文本从左侧开始。怎么让它从右边开始?


当前回答

在你的CSS中试试这个:

input {
text-align: right;
}

要使文本在中间对齐:

input {
text-align: center;
}

但是,它应该是左对齐的,因为这是默认的-并且看起来是最用户友好的。

其他回答

在CSS中使用text-align属性:

input { 
    text-align: right; 
}

这将在页面的所有输入中生效。 否则,如果你只想对齐一个输入的文本,设置样式为inline:

<input type="text" style="text-align:right;"/> 

给你:

输入[type=text] {text-align:right} < >形式 <input type="text" name="name" value=""> . > < /形式

@Html。TextBoxFor(model =>模型。IssueDate, new {@class = "form-control", name = "inv_issue_date", id = "inv_issue_date", title = "Select Invoice开票日期",placeholder = "dd/mm/yyyy", style = "text-align:center;"})

在你的CSS中试试这个:

input {
text-align: right;
}

要使文本在中间对齐:

input {
text-align: center;
}

但是,它应该是左对齐的,因为这是默认的-并且看起来是最用户友好的。

以下方法可能对你有用:

<style>
   input {
         text-align: right !important; 
   }
   textarea{
        text-align:right !important;
   }
   label {
       float: right !important;
   }
</style>