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


当前回答

@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;"})

其他回答

以下方法可能对你有用:

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

没有CSS: 使用文本输入的STYLE属性

风格= " text-align:权利;"

@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;
}

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

给你:

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