19 Matching Annotations
  1. Apr 2021
  2. Mar 2021
    1. HTML elements have meaning. "Semantically correct" means that your elements mean what they are supposed to.
    2. Semantically correct usage of elements means that you use them for what they are meant to be used for.
    3. Another example: a list (<ul> or <ol>) should generally be used to group similar items (<li>). You could use a div for the group and a <span> for each item, and style each span to be on a separate line with a bullet point, and it might look the way you want. But "this is a list" conveys more information.
    4. The classic example is that if something is a table, it should contain rows and columns of data. To use that for layout is semantically incorrect - you're saying "this is a table" when it's not.
    5. Browsers can correctly apply your CSS (Cascading Style Sheets), describing how each type of content should look. You can offer alternative styles, or users can use their own; as long as you've labeled your elements semantically, rules like "I want headlines to be huge" will be usable.
    6. Screen readers for the blind can help them fill out a form more easily if the logical sections are broken into fieldsets with one legend for each one. A blind user can hear the legend text and decide, "oh, I can skip this section," just as a sighted user might do by reading it.
    7. Mobile phones can switch to a numeric keyboard when they see a form input of type="tel" (for telephone numbers).
    8. Knowing what your elements are lets browsers use sensible defaults for how they should look and behave. This means you have less customization work to do and are more likely to get consistent results in different browsers.
    9. All of this semantic labeling helps machines parse your content, which helps users.
    10. Fits the ideal behind HTML HTML stands for "HyperText Markup Language"; its purpose is to mark up, or label, your content. The more accurately you mark it up, the better. New elements are being introduced in HTML5 to more accurately label common web page parts, such as headers and footers.
  3. Jan 2021
    1. You can style a link to look button-like Perhaps some of the confusion between links and buttons is stuff like this: <img loading="lazy" src="https://i1.wp.com/css-tricks.com/wp-content/uploads/2020/01/Screen-Shot-2020-01-08-at-8.55.49-PM.png?resize=264%2C142&#038;ssl=1" alt="" class="wp-image-301534" width="264" height="142" data-recalc-dims="1" />Very cool “button” style from Katherine Kato. That certainly looks like a button! Everyone would call that a button. Even a design system would likely call that a button and perhaps have a class like .button { }. But! A thing you can click that says “Learn More” is very much a link, not a button. That’s completely fine, it’s just yet another reminder to use the semantically and functionally correct element.
  4. Dec 2020
  5. Oct 2020
  6. Sep 2020
    1. The fully styleable primitives that the web offers (e.g. <div>) are quite powerful, but they lack semantic meaning. This means that accessibility is often missing because assistive technology cannot make sense of the div soup that we use to implement our components.
    1. The benefit of using the <ul> (unordered list) element are plenty: it will stay a list outside the context of our page, for example in Safari Reader mode, it will show as a list when printed with stylesheet turned off, it will show as a list for people who use screenreaders, it is a list (screenreaders can announce things like ‘list, 3 items’).
  7. May 2020