how to apply CSS for @Html.DisplayFor?


Tags: css,asp.net-mvc,asp.net-mvc-4

Problem :

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 enter image description here

If I use LableFor

enter image description here



Solution :

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 Howto..

    Nth-child css property is counting html elements with display property set to none. How to change it?

    How do you disable the set width of parent element for child element?

    how to overwrite inline styles in print css?

    How to align buttons properly in css/asp.net?

    CSS Transitions using AngularJS ng-show

    CSS: How does setting a right margin cause the element's parent to become visible in this example?

    Html and css. Social buttons how to move them?

    Pure CSS: Show image2 above/over/on top image1 on hover

    How do I center and auto-resize this css loader?

    how to write browser specific css properties?

    How do you get multiple views in one window like JSFiddle does [closed]

    How to apply focus css for all drop downs?

    How to display half of a character(html entity) using css (and if required jquery)

    Ideas with how to draw a specific large amount of circles on a page using a loop

    How to center multiple line text in html using css, just like
    ?

    How to re-size an image inserted via tag?

    How to select element, enclose it in a div and add a class to it, in pure javascript?

    how to make css curve box with gradient & shadow

    CSS: How to make drop down children to at least fill parent width

    CSS/HTML problem in IE - how to fix?

    How to add two class styles to anchor tag

    Show content on and off with Javascript

    How to create the timetabling with div properly?

    How to extend this navigation bar off the page?

    How can I get a relative div to expand to fit its absolute contents?

    How to select other (sibling) elements CSS?

    How to highlight table rows if error is found - Jquery

    How to mix url string & attribute value in CSS content property? [duplicate]

    how to create this css?

    How can I center div, inside other div with bootstrap classes?