Jump to content
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.Fair enough, I find that’s a rarity so use a p normally and extra elements as and when needed.
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 also use an icon as a background image on the p.
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)
Not denying that at all, that’s why I do have an image in the background of the p tag. But I like the cleanness and compactness of the source code with no image tags cluttering it up.
Putting the image declaration in the stylesheet makes it:
1) easier to change site-wide2) smaller source files (CSS file is cached so preferable to put the code in there)
I can see the argument you’re making, and don’t totally disagree with you – the second example you give is more along my lines of thinking: carry on using the background image, and add actual real text (not alt text) to convey the meaning as clearly as possible regardless of how the user is browsing the page.