Search code examples
htmlaccessibilityfaviconwcag2.0

Adding alt text and aria label to fav icon


How can we add alt text and aria label to a fav icon?

Tried the following but has no effect.

I am questioning whether a fav icon even needs these details but see no references in W3 to confirm whether it is needed or not.

Pls advice.

<!DOCTYPE html>
<html>
<head>
  <title>My Page Title</title>
  <link 
    rel="icon" 
    type="image/x-icon" 
    href="https://www.company.com/favicon.ico" 

    <!-- This doesn't do anything. And do I even need this -->
    alt="some sample" 
    aria-label="I AM ARIA LABEL"
  >
</head>
<body>

<h1>This is a Heading 12</h1>
<p>This is a paragraph. 1</p>

</body>
</html>

Solution

  • The favicon is 1.) not an img tag and 2.) does not appear in the body of the HTML code, so you don't need an alt attribute or aria label attribute for it since it won't be read by screenreaders.