I'm currently working at improving the accessibility of a site.
I'm using the TotalValidator tool to check the accessibility issues there, and the icons on the
The icons there use this format:
<link href="/full/path/to/the/image/120.png" rel="apple-touch-icon" />
<link href="/full/path/to/the/image/152.png" rel="apple-touch-icon" sizes="152x152" />
<link href="/full/path/to/the/image/167.png" rel="apple-touch-icon" sizes="167x167" />
<link href="/full/path/to/the/image/180.png" rel="apple-touch-icon" sizes="180x180" />
<link href="/full/path/to/the/image/192.png" rel="icon" sizes="192x192" />
<link href="/full/path/to/the/image/128.png" rel="icon" sizes="128x128" />
I searched about this topic and this format seems to be correct, but the accessibility report throws:
The 'sizes' attribute is not allowed here.
Does anyone knows how I should replace it? Thank you!
According to #Darek Kay, this documentation refers that:
The sizes attribute gives the sizes of icons for visual media. [...]
The attribute must not be specified on link elements that do not have a rel attribute that specifies the icon keyword or the apple-touch-icon keyword.
NOTE: The apple-touch-icon keyword is a registered extension to the
predefined set of link types, but user agents are not required to
support it in any way.
Thank you!
Related
I don't know what this icon is called and how to use it for my website. Can someone help me out.
That'd be one of the favicons you need to set on your page. If you use an automatic tool like https://realfavicongenerator.net you will be able to easily cover all the required different files using a single image.
The icon that is used to install to the homescreen is determined by using the largest icon found in one of the following tags:
<link rel="icon" sizes="192x192" href="nice-highres.png"> (recommended)
<link rel="icon" sizes="128x128" href="niceicon.png">
<link rel="apple-touch-icon" sizes="128x128" href="niceicon.png">
<link rel="apple-touch-icon-precomposed" sizes="128x128" href="niceicon.png">
Source: https://developer.chrome.com/multidevice/android/installtohomescreen#icon
Chrome uses the same icon as the favicon, bookmark icon and “Add to home screen” icon. It picks the widest PNG icon it can find which is no larger than 192×192.
Source: https://realfavicongenerator.net/blog/android-chrome-and-its-favicon/
It's called favicon. Somewhere you should have a code like this:
<link rel="icon" type="image/png" href="/favicon.png" />
Follow the href to the location. You can find it in your header somewhere.
So I'm doing some research regarding mobile site user experience and stumbled upon the fact of the whole favicon.ico being completely outdated and all.
Looking around I've gathered that I require various new sets of images/icons to actually present the "favicon" properly on various mobile devices like android, iphones and windows phones.
Now the question here is, I've got the following code:
<link rel="apple-touch-icon" sizes="57x57" href="images/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="images/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="images/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="images/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="images/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="images/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="images/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="images/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="images/favicons/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="images/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="images/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="images/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="images/favicons/manifest.json">
<meta name="apple-mobile-web-app-title" content="JoJo Productions">
<meta name="application-name" content="JoJo Productions">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-TileImage" content="images/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="images/favicons/browserconfig.xml">
<meta name="theme-color" content="#555555">
<link rel="shortcut icon" href="favicon.ico">
but for me this is just a too huge chunk of code to just show the favicon properly. So I was wondering what I would be able to remove and what I should definitely keep to present it properly on "most" mobile devices.
Most other websites that make use of mobile favicons only use a handful of the above mentioned code, being the: 57x57, 72x72, 114x114 and the 144x144 this all being the apple-touch-icons. So are the images/code parts really that important for Iphone or other mobile users? Or is it possible to have it a bit more optimised?
Either way thanks for the information.
Edit
So with some further research I've gotten to this result which seems to work okay on most modern devices:
<meta name="msapplication-config" content="images/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="images/favicons/mstile-large.png">
<meta name="msapplication-TileColor" content="#ae8160">
<meta name="application-name" content="JoJo Productions">
<link rel="shortcut icon" sizes="16x16 24x24 32x32 48x48" href="favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
Which is of course better for me as the amount of code/images has been decreased significantly. And as long as it works on most modern mobile devices I'm happy.
With a combination of this "cheat sheet", this tutorial, and the help from Philippe B. I managed to get it to this.
Either way thanks for all the help and hopefully in the coming years they'll make a proper standard for the favicon!
To address as many platforms as possible without a large set of icons, you basically need four icons:
A PNG icon, for modern, desktop browsers.
An Apple Touch icon for mobile browsers (iOS Safari of course, but also Android Chrome and many others; and also Mac OS Yosemite Safari).
favicon.ico, for legacy browsers (think IE 9, 8, ...).
A tile icon for IE on Windows 8 and 10.
This gives us:
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="msapplication-TileColor" content="#00aba9">
A few comments about this code:
apple-touch-icon.png is 180x180, which is the highest supported resolution by iOS (iOS 8 on iPhone 6+ and Retina iPad). Lesser platforms will scale the icon down.
apple-touch-icon.png is named this way and placed in the root directory of the web site because this is a convention from Apple. If you place it or name it differently, you will probably notice 404 errors in your server's logs. Nothing to worry but if you can avoid them...
favicon.png is 32x32. Not too small and not too large. You might make it large, but for no significant benefits.
favicon.ico is in the root directory of your web site because this is a convention from IE. For example, Yandex search engine expects it here.
In this example, I used mstile-144x144.png and no browserconfig.xml. I did this because it looks easier (this is just two lines of HTML and a picture; no extra XML file involved). But this choice is arguable. The msapplication-TileImag and msapplication-TileColor metas introduced by Win 8.0 / IE 10 have been replaced by browserconfig.xml in Win 8.1 / IE 11. So browserconfig.xml is a longer term solution. Plus, if you put this file in the root directory of your site, you don't have to declare it in the HTML: IE 11 will find it by convention ("favicon.ico" style). Note that Coast by Opera picks msapplication-TileImag for bookmarks. Now make your choice!
A final note: the large code chunk you quote in your question was generated by RealFaviconGenerator. As the author of this tool, your question makes me sad ;-)
well I've searched upon the web for an answer, yet to find a solution.
I'm trying to add an iPhone web app icon (the one when you save the webpage to your home-screen) through the following code:
<link href="http://localhost:5001/Images/cc.png" rel="apple-touch-icon" />
<link href="http://localhost:5001/Images/cc-76x76.png" rel="apple-touch-icon" sizes="76x76" />
<link href="http://localhost:5001/Images/cc-120x120.png" rel="apple-touch-icon" sizes="120x120" />
<link href="http://localhost:5001/Images/cc-152x152.png" rel="apple-touch-icon" sizes="152x152" />
P.S - I'm programming using Visual Studios 2013 and running the app through localhost
After some research I came to a conclusion that my problem might be in how I link the image's place - people say you need to place it in the root document folder but I couldn't figure out how to do so
Thanks in advance for any help :)
Add a simple bit of code to the HEAD of your site so the devices can find your images ,it is recommended to create the icon for the respective sizes and add them to your site's root folder)
Code is as follows (According to ios 7)-
<link href="http://www.yoursite.com/apple-touch-icon.png" rel="apple-touch-icon" />
<link href="http://www.yoursite.com/apple-touch-icon-76x76.png" rel="apple-touch-icon" sizes="76x76" />
<link href="http://www.yoursite.com/apple-touch-icon-120x120.png" rel="apple-touch-icon" sizes="120x120" />
<link href="http://www.yoursite.com/apple-touch-icon-152x152.png" rel="apple-touch-icon" sizes="152x152" />
How do i do if I want the logo to appear in the address bar?
I tried to add link to a jpg I saved as favicon but doesn't work.
<link rel="stylesheet" type="text/css" href="general-style.css">
<link rel="stylesheet" type="text/css" href="sequence-style.css">
<link rel="shortcut icon" href="images/favicon.ico">
I usually put both of these
<link rel='icon' href='favicon.ico' type='image/x-icon' />
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon' />
In some browsers if the icon file is in the root they actually seek them out even if you dont put the links in.
A favicon should be in ICO format, not JPEG, if you want it to show up in most browsers. That is the only format that Internet Explorer supports before version 11.
Some other formats are supported, if you accept that it won't work at all in some browsers. See the File format support chart.
If you search the web for "favicon" you will find several online converters where you can convert your image to ICO format.
I have a page1 including page2 with "iframe" tag,both of these two pages link to the same stylesheet,everything works fine,until i press "F12" to toggle developer tool in IE10,some of the classes miss styles defined in the css file suddenly,and the two pages go into a wrong display. Can anyone help?
there are two methods to solve this problem, change the class name or add a timestamp after style url. Why?
This is a bug in IE10.
You can add a query string in page2 to fix this bug:
page2:
<link rel="stylesheet" href="css/base.css?t=2013" />
<link rel="stylesheet" href="css/layout.css?t=2013" />
page1:
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/layout.css" />