Jump to content
@seb frost: to answer both of your questions…
“why the extraneous div around the p â€“ this seems like wasted markup to me, i tend to just use class=â€errorâ€ on my p tag and apply all the styling needed directly to that.”
Sure – but often I’ll use a div with class of error and then I can place whatever content I want in there and I’m not limited to one paragraph.
“I also prepend â€œError: â€ at the start of the error message. I like having that text visible even to normal users, and obviously it will work fine for screen readers and the like.”
That’s another possibility, to be certain. However, do you also inlude an icon or other visual representation of status/state that shows an error had occurred? Or are you relying simply on “text” to convey all of your message?
“Iâ€™d much rather that than put a needless (IMHO) image tag every time I have an error/message/warning etc on a page.”
Why is it needless? Do you not believe that images can convey information quickly and effectively? (I’m not asking this sarcastically – I’m geniunely interested in the answer)