One of these might help:
https://forum.mendix.com/questions/5306/Styling-using-CSS-in-Mendix-5
https://forum.mendix.com/questions/6009/Style-areas-of-a-page-in-Mendix-511
/* Non-editable DataView fields
===========================================================================*/
div[id^=mxui_widget_TextInput]>label,
div[id^=mxui_widget_TextArea]>label,
div[id^=mxui_widget_BoolSelect]>label,
div[id^=mxui_widget_NumberInput]>label,
div[id^=mxui_widget_DateInput]>label,
div[id^=mxui_widget_EnumSelect]>label,
div.mx-referenceselector-input-wrapper>label{
background-color: #f9f9f9;
border: 1px solid #cccccc;
border-radius: 4px;
display: block;
color: #808080;
text-indent: 2px;
line-height: 10px;
height: 25px;
}
For those who are using a Mendix theme in > Mx5.18 here another solution:
add this to your custom.css
.form-control-static, .form-group div[class='textBox'] > label, .form-group div[class='textArea'] > label, .form-group div[class*='datePicker'] > label {
background-color: #F7F7F7;
border: 1px solid #CCCCCC;
border-radius: 4px;
padding: 5px 8px;
width: 100%;
}
There is no specific class or structure in place that you could use for that.
You could try and use the structure of the html, the label is always placed inside a div, what you could do is style it based on that?
.mx-dataview-content div label { /* The CSS */ }
But I would recommend entering a feature request for this, because the above css could potentially influence other information as well.