Day 4 - HTML accessibility basics, CSS Basics
by Nino · 32 things on Twos
- Mimo: finished (4. Semantic HTML)
- —-
- <div> and <span> are containers, generic, lists are better
- consider descriptive action calls for buttons and links, ex. Show more vs Click
- alternative texts, no need if images are decorations
- WAI-ARIA stands for Web Accessibility Initiative-Accessible Rich Internet Applications and it's a specification for accessibility standards.
- <html lang="en">
- <div role="banner">, helps readers know that it's header
- role samples:
banner = header
comment = comment
img = images into a single block
contentinfo = footer elements - copyright, contact, privacy info
alert = events or changes in the content, urgent info, command to fill all inputs
- <p aria-hidden="true"> = to hide decorative elements that might distract screen readers
- always choose semantic tags over roles, ex. actual buttons
- ✓ review <span>
- —-
- Mimo: semi-completed (5. Accessibility Basics)
- —-
- CSS styling in HTML, can have multiple attributes
- style="color: green;"
- background-color: red;
- more examples: font-size, font-family
- units "px" follow after number
- font-style: italic; font-weight: bold;
- Using style tags, add <style></> inside head to apply to all specific tags
- CSS rule: a selector and its declarations, use of curly braces
- body selector, to apply all elements inside the body element
- CSS style sheet
- <link href="style.css" rel="stylesheet"> insert inside <head>
- <li class="gray-element">, sample class attribute inside a list, used for styling different classes
- class selectors aren't unique, can use dash or camelNotation
- .gray-element {
background-element: lightGray;
}
// a selector and its properties
// add rule after a period in the style sheet
- text-decoration: line-through;