Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a screenreader pronounce C# correctly

On my website, I reference the programming language C#. A screen reader will read this as "C number".

Is it worth trying to force a screenreader pronounce "C sharp"?

If so, I have tried <span aria-label="C sharp">C#</span>, but the <span> stops the screenreaders flow... And even when I hover the 'C#' text, it is still pronounced "C number".

Any suggestions?

like image 694
jackdomleo7 Avatar asked Oct 21 '25 12:10

jackdomleo7


1 Answers

I would wrap it in abbr tags and provide C Sharp as the title attribute. You are adding semantic meaning to your markup that can then be used by assistive technology. It's not really worth trying to force a screen reader to read it correctly as you'll likely make things confusing and most users will set their screen reader to read abbreviations to their own preference.

<abbr title="C Sharp">C#</abbr>
like image 67
James Coyle Avatar answered Oct 23 '25 00:10

James Coyle