如何应用CSS的@ Html.DisplayFor? [英] how to apply CSS for @Html.DisplayFor?

查看:540
本文介绍了如何应用CSS的@ Html.DisplayFor?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将css应用于DisplayFor。我不能。如何做?

  MeetingAbstract.AbstractTitleInEnglishLabel = meetingQuestionses [0] .question_text 

@Html。 DisplayFor(model => model.AbstractTitleInEnglishLabel,new {@class =control-label mandatory})

如果我使用 DisplayFor
LableFor



解决方案

DisplayFor 用作模板系统。如果你不使用模板,你应该坚持把它包装在一些html标签中。


I was trying apply css to DisplayFor. I could not. How to do that?

 MeetingAbstract.AbstractTitleInEnglishLabel = meetingQuestionses[0].question_text

@Html.DisplayFor(model => model.AbstractTitleInEnglishLabel, new { @class = "control-label mandatory" })

If I use DisplayFor. It shows like no bold

If I use LableFor

解决方案

DisplayFor is used as a templating system. If you are not using a template, you should probably stick with wrapping it in some html tags.

这篇关于如何应用CSS的@ Html.DisplayFor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆