How to style the DisplayFor HTML helper in MVC

Home > Search > How-to
  by

Add add background style to text:

<style>
.tags {
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background: #eeeeee;
    padding: 2px;
}
</style>

<span class="background"> @Html.DisplayFor(model => model.column1)</span>



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments