function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

trouble seeing apex:messages style

I'm sorry for such a stupid question but I'm at a complete loss.


Any idea why this doesn't work:



<apex:messages style="font-color:red;"/>


<apex:messages style="font-color:red;"/>


I get the messages, but no color :(


Best way is to define style class first.


Try out the sample code given below :



             .locationError { color: red; font-weight: strong;}


            <apex:messages styleClass="locationError" /> <p />

           // with styleclass

            <apex:outputText value="Styled Text in a sample style class" styleClass="locationError"/>

           // without styleclass

            <apex:outputText value="Styled Text in a sample style class" style="color:blue;font-style:italic"/> <p />


Dont use color in style as style="font-color:red;". Modify your code like style="color:blue"


Did this answer your question? if so, please mark it solved.



<apex:messages style="color:red;"/>




Use below to have the exact same color as normal error messages (dark red)



<apex:messages styleClass="errorMsg"/>