#30 Bullet “list”

submitted on by Huy Ngo

Bad code Bad code

<p>
• HTML
<br>
• CSS
<br>
• JavaScript
</p>

Issues and how to fix them Issues and how to fix them

  1. 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.
  2. The “list” won't be announced as a list when using a screen reader.
  3. <ul> and <ol> provide useful semantic information. What and how assistive technology announces information differs, but:
    1. screen readers might announce it as a “list with items”
    2. screen readers might announce the number of items in the list, e.g. “list with 3 items”
    3. screen readers might announce the bullet or number of each item
    4. screen readers might announce when you enter or leave a list
  4. Screen reader users may use shortcuts to jump from list to list on a page
  5. <ul> and <ol> provide a selector for styling in CSS
  6. When copying the fake list, all the bullets will go along with it
  7. You can turn the bullet into a fire emoji using ::marker 🔥

Good code Good code

<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>