User Tools

Site Tools


html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
html [2022/06/01 12:58] – html_editor page link rjthtml [2023/12/09 20:04] (current) – syntax fix rjt
Line 23: Line 23:
   : You can specify alternative appearances for you page, which in [[firefox]] are accessed via ''View > Page Style'' (or ''Alt v y''). You can also have a base sheet that is applied to all.   : You can specify alternative appearances for you page, which in [[firefox]] are accessed via ''View > Page Style'' (or ''Alt v y''). You can also have a base sheet that is applied to all.
   : [[https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets]]   : [[https://developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets]]
 +  : [[web_browser#alternate_stylesheet|Web Browser§Alternate Stylesheet]] for notes on browser support.
   ; ''rel'' attribute   ; ''rel'' attribute
   : I always forget about this one. Some cool values are:    : I always forget about this one. Some cool values are: 
Line 43: Line 44:
   * https://report-uri.com/   * https://report-uri.com/
   * https://csp-evaluator.withgoogle.com/   * https://csp-evaluator.withgoogle.com/
 +
 +==== Alternate Images ====
 +
 +Kinda cool, but I haven't had much luck with it, and the syntax is yuck, but you can provide multiple images in different sizes and fits and the browser can grab the best one for the readers situation. So small images for mobile, different dimensions for portrait or landscape modes...
 +
 +There are two ways to do this:
 +
 +  - A regular ''img'' element, with the ''srcset'' attribute.
 +  - A ''picture'' element, which is like an equibilant of the ''video'' and ''aaudio'' elements.
 +  
 +Rough notes:  
 +
 +  * srcset in img best support
 +  * srcset leaves choice to browser, picture is for control
 +  * srcset happens on page load, picture can change on the fly
 +  * srcset attribute in img element
 +
 +  * https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
 +
 +===== Not-Cool Things =====
 +
 +IDs have to start with a letter, or they will be a pain to target in the [[CSS]] file.
  
 ===== Accessibility ===== ===== Accessibility =====
  
 ==== WAI-ARIA ==== ==== WAI-ARIA ====
- 
  
   * https://www.w3.org/TR/wai-aria/ - Spec.   * https://www.w3.org/TR/wai-aria/ - Spec.
     * https://www.w3.org/TR/aria-in-html/     * https://www.w3.org/TR/aria-in-html/
   * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA   * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
 +
 +Some useful ''role''s:
 +
 +  ; ''search''
 +  : Eg: ''<form role="search">''
 +  ; ''tablist'',''tab'', ''tabpanel''
 +  : ''tablist'' is the container, which contains ''tab''s, which when clicked display ''tabpanel''s.
 +  ; ''tree'', ''treeitem''
 +  : For lists that can be collapsed and expanded.
 +  : Eg: ''<ul role="tree"><li role="treeitem">'' ...
  
 ==== Media ==== ==== Media ====
Line 65: Line 97:
   * If it's an image you can use ''role="img"'' to tell the screenreader.   * If it's an image you can use ''role="img"'' to tell the screenreader.
   * If your drawing's inside a ''<figure>'' you might want to use the ''aria-labelledby="[id]"'' or ''aria-describedby="[id]"'' attributes to point to the id on an element that has a description, for example a ''<figcaption>''   * If your drawing's inside a ''<figure>'' you might want to use the ''aria-labelledby="[id]"'' or ''aria-describedby="[id]"'' attributes to point to the id on an element that has a description, for example a ''<figcaption>''
 +
 +==== prefers-reduced-motion ====
 +
 +You can change that way things like animations play for people that have set certain preferences i ntheir browser or OS.
 +
 +  * https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
  
 ===== Things I Forget ===== ===== Things I Forget =====
  
-**Number oen thing I forget is to check this page!**+**Number one thing I forget is to check this page!**
  
 To nest a list, the sublist needs to be inside an ''<li>'' element, not the ''<ul>'', ''<ol>'', or ''<dl>''. Seems ugly to me, but makes //a kind// of sense. So: To nest a list, the sublist needs to be inside an ''<li>'' element, not the ''<ul>'', ''<ol>'', or ''<dl>''. Seems ugly to me, but makes //a kind// of sense. So:
Line 85: Line 123:
 </code> </code>
  
-I'm always forgetting that ''<ins>'' is the element that pairs with ''<del>''.+I'm always forgetting that ''<ins>'' is the element that pairs with ''<del>''Keep thinking it'll be something like replace (rel, rep??)
  
 ===== See Also ===== ===== See Also =====
  
   * [[html_editor]]   * [[html_editor]]
 +  * [[css]]
  
 {{tag>accessibility guide HTML hypermedia language markup-language}} {{tag>accessibility guide HTML hypermedia language markup-language}}
html.1654052289.txt.gz · Last modified: 2022/06/01 12:58 by rjt