Template talk:Mono

Use for code
The documentation for this template currently says it should not be used for inline source code, but I and others have been using it for this purpose because : The quick brown fox —Anomalocaris (talk) 19:41, 16 May 2021 (UTC)
 * : The quick brown fox
 * : Harvard
 * : Harvard

I had forgotten that I had posted the above, and I just edited and removed a bunch of edits to this talk page based on the belief that the template has problems around  tags. I now believe the problem related to wikilinks. The problem with wikilinks and external links remains and should be fixed. —Anomalocaris (talk) 04:25, 13 July 2022 (UTC)
 * [I took the liberty of numbering the examples above for clear reference.] Testing so far:
 * Chrome: All examples display in monospaced font as expected.
 * Opera: All examples render in sans-serif (or whatever your browser, your user CSS, or your "skin" have set WP's default text to).
 * Opera GX: Same as Opera.
 * Firefox: Same as Opera.
 * Edge: Same as Opera.
 * Brave: Same as Opera.
 * That's all in Windows 11. This seems doubly strange to me. What should be expected across all of these browsers (and any others) is for examples 1 and 3 to render in monospace, because the template is the linked text, so the default link-styling CSS should be overridden by the more specific, interior class of the mono template; but examples 2 and 4 should rendered sans (or whatever your settings dictate), because the template comes first then is overriden by more specific link conditions. Without closely scrutinzing the rendered HTML source in each browser, I'm not entirely sure why this is happening or what to do about it. None of the browsers are doing what is expected, yet Chrome is doing something very different from the rest (despite several of them also being based on the Chromium engine on which Chrome is obviously built). I have too many projects going on already; maybe someone else can look into this in more detail. Addition text cases, with partial-monospacing of the link text:
 * 1a. : The quick brown fox
 * 3a. : Harvard University
 * And inline markup:
 * 1b. :  The quick brown fox
 * 3b. : Harvard
 * 1c. : The quick brown fox
 * 3c. : Harvard University
 * Those all (1a through 3c) display as expected in Chrome; not tested yet any further.  — SMcCandlish ☏ ¢ 😼  12:04, 2 May 2024 (UTC)

Repetition in TS style
Just curious. Currently, Template:Mono/styles.css has font-family: monospace, monospace;

Is there a reason for this repetition? -DePiep (talk) 18:15, 19 November 2021 (UTC)
 * Yes, see the information in WP:MONO linked in the comment above. Basically some browser threat  specially and reduces the font size.   works around this. I'm not sure if this still is a problem in newer browsers. See also . -- Tholme (talk) 15:15, 15 March 2022 (UTC)

Obsolete CSS trick?
The  trick, to stop certain browsers from messing with the relative font size of monospaced text, reportedly no longer works across all browsers, while   or   will work (and no browser will change the display to [sans-]serif, because "monospace" is matched first). NB: I got this from forums (StackExchange, I think, and some others, not from CSS books from Wiley or the like.  — SMcCandlish ☏ ¢ 😼  11:31, 2 May 2024 (UTC)