<p></p>
<p dir="auto">Been meaning to find the right file to commit this into and propose it as pull request but I keep not getting around to it...</p>
<p dir="auto">Simple CSS-only solution that doesn't change anything else except lets you see the title text for <code class="notranslate">abbr</code> elements on mobile and desktop consistently:</p>
<p dir="auto"><a href="https://github.com/user-attachments/assets/a38b02f5-216c-4de9-a995-4f6f1f5415f4">image.png (view on web)</a></p>
<p dir="auto">(The cursor is actually a hand/pointer; screenshot software does not capture that.)</p>
<div class="highlight highlight-text-html-basic" dir="auto"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">style</span><span class="pl-kos">></span>
abbr[title] {
position: relative;
/* ensure consistent styling across browsers */
text-decoration: underline dotted;
}
abbr[title]:hover::after,
abbr[title]:focus::after {
content: attr(title);
/* position tooltip like the native one */
position: absolute;
left: 0;
bottom: -30px;
width: auto;
white-space: nowrap;
/* style tooltip */
background-color: #1e1e1e;
color: #fff;
border-radius: 3px;
box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.4);
font-size: 14px;
padding: 3px 5px;
}
<span class="pl-kos"></</span><span class="pl-ent">style</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>="<span class="pl-s">/issues/</span>"<span class="pl-kos">></span>There are <span class="pl-kos"><</span><span class="pl-ent">abbr</span> <span class="pl-c1">title</span>="<span class="pl-s">seven!</span>" <span class="pl-c1">tabindex</span>=<span class="pl-s">0</span><span class="pl-kos">></span>how many?<span class="pl-kos"></</span><span class="pl-ent">abbr</span><span class="pl-kos">></span> issues with this approach!<span class="pl-kos"></</span><span class="pl-ent">a</span><span class="pl-kos">></span></pre></div>
<p dir="auto">CSS from <a href="https://stackoverflow.com/a/69353021/1201863" rel="nofollow">https://stackoverflow.com/a/69353021/1201863</a>. Tested that the code works in normal text and also nested, for example in an <code class="notranslate"><a></code> link</p>
<p dir="auto">The <code class="notranslate">tabindex</code> makes it selectable such that screen reader users can hopefully also open it. Regarding the value, <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex" rel="nofollow">MDN says</a> <code class="notranslate">tabindex=0</code> "means that the element should be focusable in sequential keyboard navigation" -- it does <em>not</em> put it at the top of the tab stack!</p>
<p dir="auto">Hopefully this covers everyone's (accessibility) requirements by looking like what people expect from a tooltip while also not requiring javascript. I'm kind of blown away that mobile browsers, after all these years, still can't just do tooltips natively...</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/631#issuecomment-2423281118">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMMBOMFSTUOZT2POV3Z4F7AFAVCNFSM6AAAAABQGYIMA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRTGI4DCMJRHA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLK5XPNBUCYOTJSOZJ3Z4F7AFA5CNFSM6AAAAABQGYIMA6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUQOBK54.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/631/2423281118</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/631#issuecomment-2423281118",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/631#issuecomment-2423281118",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>