I'm busy writing an online chat, and although it doesn't really matter which I use, since I can style them however I want with CSS, I'd quite like to use the best tag for messages.
My first thought was to use an <ol> since the messages are ordered by time. However, Facebook uses <ul>s and Google chat uses <div>s. Twitter does use <ol>.
So, which is semantically correct? And, which would be best for user with screen readers?
div only. <ul><ol> are lists. Chat messages are not ordered list, it is obvious. If you dont need bullets/dots/other marker near each message - they are not unordered list too.
Also using div you dont need to reset default styles for lists = less CSS code you will write.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With