In the attached test case, the three outlined boxes are laid out at their narrowest possible width without breaking words, because despite being position:absolute (which takes them out of flow) and width:auto, they are *structurally* inside containers with fixed, narrow widths. If you comment out width:30px in the first style declaration, they are instead laid out at their widest possible width given the max-width setting and the measure of the text. As far as I can tell, there is no way to get the "widest possible" behavior with this HTML structure and a fixed-width parent element. It would be nice if there were such a way; this structure may be necessary for other reasons (I tripped over this while trying to put <details> elements in a table).
This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:27 UTC