I have created a custom Login page for my customer portal but the problem is that if I want errors to display when the user enters wrong credentials I am forced to use <apex:pageMessages id="error" />
but this breaks a few styling elements on the page. I have looked into <apex:pageMessage />
but they always display. Per Salesforce,
This pageMessage will always display. Validation error
messages appear in the pageMessages component.
So my question is how can I display my own error messages using <apex:pageMessage />
or control the styling of <apex:pageMessages />
Best Answer
I will not try to reproduce the excellent answer already provided by @JesseAltman, but I believe this will help you do whatever you need around your error messages.
It goes over each messaging option (In a ridiculous amount of detail). Also goes over the caveats of each, which does include styling. I would take a look.
Difference between the multiple messaging options in Visualforce?