为html.EditorFor添加样式_html/css
来源:动视网
责编:小采
时间:2020-11-27 16:27:05
为html.EditorFor添加样式_html/css
为html.EditorFor添加样式_html/css_WEB-ITnose:有网友问及,怎样为html.EditorFor添加样式。解决方法,可以参考下面语法: 先new一个htmlAttributes。 @model Book@using Insus.NET.Models;@{ Layout = null;} Index .EditClassFormat { width: 300px
导读为html.EditorFor添加样式_html/css_WEB-ITnose:有网友问及,怎样为html.EditorFor添加样式。解决方法,可以参考下面语法: 先new一个htmlAttributes。 @model Book@using Insus.NET.Models;@{ Layout = null;} Index .EditClassFormat { width: 300px

有网友问及,怎样为html.EditorFor添加样式。
解决方法,可以参考下面语法:
先new一个htmlAttributes。
@model Book@using Insus.NET.Models;@{ Layout = null;} Index ISBN: @Html.EditorFor(x => x.ISBN, new { htmlAttributes = new { @class = "EditClassFormat" } })
看看效果:
为html.EditorFor添加样式_html/css
为html.EditorFor添加样式_html/css_WEB-ITnose:有网友问及,怎样为html.EditorFor添加样式。解决方法,可以参考下面语法: 先new一个htmlAttributes。 @model Book@using Insus.NET.Models;@{ Layout = null;} Index .EditClassFormat { width: 300px