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

    How to set my Django form on the center of the page

    How to fix a double click on a jQuery slide up/down animation?

    How to target content through css

    How to change ol bullets for clickable images

    How to fit css textbox to content?

    How to center multiple div elements within a parent div?

    How To Vertically Center Text Over Responsive Video

    How to remap CSS shortcut key in Mac Bluefish text editor

    In html how do I have table within table look visually the same as if I didnt have the inner table

    How to make dynamic slideshow using php, mysql, css and html?

    How to prevent the CSS `:before` text being editable while the `div` itself is editable?

    How to precisely center bootstrap grid in html page?

    How to accurately position divs with css

    CSS: 2-column table, how to make one column as small as possible but no wrap and the other as big as possible?

    How to center a button WITHOUT a div using CSS

    How to use css style in php

    How to make CSS for search results

    How to center a DIV with CSS?

    How to put the menu over the content?

    How to break text inside a parent div with white-space:nowrap in CSS?

    Jquery: show IMG on click

    How to keep CSS class on menu item with dropdown

    I have a blinking box, how can I add a gradient to this or program it easier?

    How to add html special character (right-arrow) using content property of css? [duplicate]

    How to prevent links from wrapping in CSS megamenu div (inheritance issue)

    How to group CSS/Javascript button behaviour? [closed]

    How to set borders between children from parent in CSS?

    How to target a specific browser of a specific device via CSS?

    How do I isolate an image from the html so that I can edit where it goes on the website?

    HTML emails in 2013: How to control spacing between elements like paragraphs and images?