3

I note that in the WHAT-WG section on:

link rel="icon"

Every icon referenced includes a sizes attribute:

<link rel=icon href=favicon.png sizes="16x16" type="image/png">
<link rel=icon href=windows.ico sizes="32x32 48x48" type="image/vnd.microsoft.icon">
<link rel=icon href=mac.icns sizes="128x128 512x512 8192x8192 32768x32768">
<link rel=icon href=iphone.png sizes="57x57" type="image/png">
<link rel=icon href=gnome.svg sizes="any" type="image/svg+xml">
<link rel=stylesheet href=lsforums.css>

Source: https://html.spec.whatwg.org/dev/links.html#rel-icon

But, to my knowledge, the sizes attribute has never been required.

I'm trying to find an authoritative source confirming the sizes attribute is optional. I cannot.

In <link rel="icon">, is the sizes attribute required or optional?

I am specifically looking for an authoritative source - thanks.

1 Answer 1

5

I finally found what I was looking for. I've added emphasis to the quote below:

The sizes attribute gives the sizes of icons for visual media. Its value, if present, is merely advisory. If specified, the attribute [...] The attribute must only be specified on link elements that have a rel attribute that specifies the icon keyword or the apple-touch-icon keyword.

Source: https://html.spec.whatwg.org/dev/semantics.html#attr-link-sizes

2
  • 1
    But if the sizes attribute is present, is each size specified as height_x_width or width_x_height? W3Schools says the former, but what is the authority for this? Commented Jun 6, 2021 at 15:20
  • 2
    @WebSmithery check out the HTML living standard, it specifies that the first dimension is the width.
    – Severo Raz
    Commented Sep 24, 2021 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.