本文介绍了我需要为以下文本框和textarea提供相同的样式。有可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<ul class="feildsmain">
@*<li>
@Html.LabelFor(m => m.BussinessID) </li>*@
<li>
@Html.HiddenFor(m => m.BussinessID)
@Html.ValidationMessageFor(m => m.BussinessID)
</li>
<li>
<li>
@Html.LabelFor(m => m.Name)
</li>
<li>
@Html.TextBoxFor(m => m.Name, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.Name)
</li>
<li>
@Html.Label("Street Address")
</li>
<li>
@Html.TextAreaFor(m => m.Address, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.Address)
</li>
<li>
@Html.Label("City")
</li>
<li>
@Html.TextAreaFor(m => m.City, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.City)
</li>
<li>
@Html.Label("State")
</li>
<li>
@Html.TextAreaFor(m => m.State, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.State)
</li>
<li>
@Html.Label("Country")
</li>
<li>
@Html.TextAreaFor(m => m.Country, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.Country)
</li>
<li>
@Html.LabelFor(m => m.ZipCode)
</li>
<li>
@Html.TextBoxFor(m => m.ZipCode, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.ZipCode)
</li>
<li>
@Html.LabelFor(m => m.Description)
</li>
<li>
@Html.TextAreaFor(m => m.Description, new { @readonly = "readonly" })@*Dropbox type*@
@Html.ValidationMessageFor(m => m.Description)
</li>
<li>
@Html.LabelFor(m => m.VideoPath1)
</li>
<li>
@Html.TextBoxFor(m => m.VideoPath1, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.VideoPath1)
</li>
<li>
@Html.LabelFor(m => m.VideoPath2)
</li>
<li>
@Html.TextBoxFor(m => m.VideoPath2, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.VideoPath2)
</li>
<li>
@Html.LabelFor(m => m.VideoPath3)
</li>
<li>
@Html.TextBoxFor(m => m.VideoPath3, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.VideoPath3)
</li>
<li>
@Html.LabelFor(m => m.VideoPath4)
</li>
<li>
@Html.TextBoxFor(m => m.VideoPath4, new { @readonly = "readonly" })
@Html.ValidationMessageFor(m => m.VideoPath4)
</li>
<li>
@Html.LabelFor(m => m.GMap)
</li>
<li>
@Html.TextBoxFor(m => m.GMap)
@Html.ValidationMessageFor(m => m.GMap)
</li>@using (Html.BeginForm())
{
<li style="text-align:right">
<input type="submit" value="Delete" style="background-color:#3a95db;" />
<input type="button" value="Back to List" onclick="location.href='@Url.Action("Index","Admin")'" style="background-color:#3a95db;" />
</li>}
<li></li>
</ul>
推荐答案
<style>
.customStyle
{
color:red;
}
</style>
<input type="text" class="customStyle" value="I am a textbox">
<textarea rows="4" cols="40" class="customStyle">
I am a textarea
现在,您可以根据要求为两个控件设置相同的样式。您可以在代码中实现这个简单的概念。
Now you will have the same style for both controls as you asked. You can implement this simple concept in your code.
这篇关于我需要为以下文本框和textarea提供相同的样式。有可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!