[go: up one dir, main page]

Today I Learned

tags


2022/01/10

Of the html table <caption> element


2022/09/20

A hack to detect if an element is visible/not:

const isVisible = (el) => (el.offsetWidth || el.offsetHeight) > 0;

see https://stackoverflow.com/questions/1343237/how-to-check-elements-visibility-via-javascript


2022/12/18

That you can group fields in an html form with a <fieldset> tag, and that it accepts a top-level child <legend> tag. Together,

<fieldset>
  <legend>Legend</legend>
  <div>...</div>
</fieldset>

produces

  ┌────legend─────┐
  │               │
  │               │
  │      ...      │
  │               │
  │               │
  └───────────────┘

which is simultaneously cool and hard to style.


2022/12/26

That you need to set a value="number" attribute AND a max="number" attribute on a html <progress> element in order to display fractional progress.

See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress


2024/12/09

That the <del>/<ins> elements can be styled to create nice preformatted diffs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins