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
eliotstock2eliotstock2 

messages tag styleClass attribute not working

Hi there.

 

I have a messages tag in a VF page like this:

 

 

<apex:messages styleClass="error"/>

 

and I am then adding a message to the page in my controller. The resulting HTML has no CSS class attriubute:

 

 

 <ul>
<li> My error message. </li>
</ul>

 

The CSS class exists. It's in a stylesheet pulled in as a static resource. Am I using this incorrectly or does it just not work?

 

Thanks,

 

Eliot Stock.

 

Ron HessRon Hess

try to wrap the page messages in a div or output panel

 

 

<apex:outputPanel sytleClass="error" > <apex:messages /> </apex:outputPanel>

 

 then your style should be applied to the outer div/span.  i think your class should specify

 

.error li  { sytle here }