畫面中textarea與標題比例設定為 (col-xl-2):(col-xl-4)
但textarea一開始顯示一直如第三個textarea區域所示約只佔了一半
一開始一直使用max-width: 100% 結果完全無效
最後使用 style = "width: 100%"就可以了
@Html.TextArea("MailTo", "", new { @class = "form-comtrol", @style = "width: 100%; max-width: 100%;" }) → OK
@Html.TextArea("MailTo", "", new { @class = "form-comtrol", @style = "width: 100%" }) → OK
@Html.TextArea("MailTo", "", new { @class = "form-comtrol", @style = "max-width: 100%" }) → X
*補充 欄位長度使用 @rows = "" 控制
另爬文看到可使用 "htmlAttributes",以下兩行顯示結果為相同
@Html.TextArea("MailToGroup", "", new { @class = "form-comtrol", @style = "width: 100%", @placeholder = "請輸入AD群組Mail", @rows = "12" })
@Html.TextArea("MailToGroup", "", htmlAttributes: new { @class = "form-comtrol", @style = "width: 100%", @placeholder = "請輸入AD群組Mail", @rows = "12" })
參考: http://www.ojit.com/article/1584005