Bad code
<p>
• HTML
<br>
• CSS
<br>
• JavaScript
</p>
Issues and how to fix them
- Use
<p>
for paragraphs, not lists. The standard way for creating basic lists is <ul>
(when the order doesn't matter) or <ol>
(when the order matters), and <li>
for each item. - The “list” won't be announced as a list when using a screen reader.
<ul>
and <ol>
provide useful semantic information. What and how assistive technology announces information differs, but:- screen readers might announce it as a “list with items”
- screen readers might announce the number of items in the list, e.g. “list with 3 items”
- screen readers might announce the bullet or number of each item
- screen readers might announce when you enter or leave a list
- Screen reader users may use shortcuts to jump from list to list on a page
<ul>
and <ol>
provide a selector for styling in CSS- When copying the fake list, all the bullets will go along with it
- You can turn the bullet into a fire emoji using
::marker
🔥
Good code
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>