- Мета-теги HTML для Apple Safari
- Apple Touch Icon
- Apple Touch Icon Precomposed
- Mask Icon
- Apple-Mobile-Web-App-Title
- Apple-Mobile-Web-App-Capable
- Apple-Mobile-Web-App-Status-Bar-Style
- Apple-Itunes-App
- Format-Detection
- Для чего используется Apple Touch Icon в 2019 году?
- Техническая сторона
- Apple-touch-icon-precomposed.png и к apple-touch-icon.png, в чем различия?
- Размеры для apple-touch-icon
- Таблица размеров
- Как прописать в коде apple-touch-icon?
- Использование в поисковой выдаче
- Заключение
- Apple-touch-icon generator
- Create Apple touch icons for your site
- About Apple touch icons
- Link to this page: “Apple-touch-icon generator”
- Apple Touch icon for websites
- 8 Answers 8
Мета-теги HTML для Apple Safari
Обзор html мата-тегов для браузеров Safari на платформах Mac OS X и iOS.
Apple Touch Icon
Иконка сайта в iOS на экране закладок и домашнем экране.
Иконки разных размеров указываются атрибутом sizes :
Apple Touch Icon Precomposed
Тоже самое что и apple touch icon , но с наложенными эффектами в стиле iOS с закругленными углами и т.д.
Mask Icon
Используется в MacOS при сохранении сайта на рабочий стол. Элементы SVG должны быть черного цвета, цвет задается атрибутом color .
Apple-Mobile-Web-App-Title
При добавлении сайта на домашний экран в iOS задает имя иконки.
Apple-Mobile-Web-App-Capable
В Safari iOS для закрепленных сайтов на экране «Домой» включает полноэкранный режим.
Apple-Mobile-Web-App-Status-Bar-Style
Задает стиль панели состояния при полноэкранном режиме.
Может иметь следующее значение:
default | Белый фон |
black | Черный фон |
black-translucent | Прозрачный фон и белый цвет иконок и шрифтов |
| | |
Apple-Itunes-App
В iOS Safari выводит баннер с приложением в App Store.
Баннер не отобразится, если устройство не поддерживает приложение или оно недоступно для данной локали, подробнее на developer.apple.com.
Format-Detection
В iOS запрещает распознавать номера телефонов и адреса.
Источник
Для чего используется Apple Touch Icon в 2019 году?
Apple-touch-icon.png – это миниатюрное изображение, представляющее ваш сайт на устройствах с операционной системой (iOS).
В коде страницы имеет следующий вид:
Это изображение в основном используется на iOS, не распространяется для macOS. Для macOS используется изображение в формате svg, а атрибут rel будет иметь значение mask-icon. Важно это понимать и не путать в будущем.
Также Apple Touch Icon могут использовать другие платформы и приложения. Ведь, как правило, это изображение хорошего качества, имеющее высокое разрешение. Так, например, браузер Chrome на Android может использовать apple-touch-icon.png для сохранения ссылки с сайта на рабочий стол.
Создать его можно с помощью функции Web Clips. Web Clips – это разработка значка веб-страницы на рабочем столе яблочного девайса.
Если вы читаете эту статью на устройстве с установленной iOS и не знаете, как создавать Web Clips, можно сделать это прямо сейчас.
Для браузера Safari
Нажать кнопку «Поделиться»
В появившейся панели нажать кнопку «На экран Домой»
Если вас не устраивает название страницы, можно написать свое, например, 1PS. Затем нажать «Добавить».
Все готово – вот так выглядит Web Clips на рабочем столе устройства.
Однако не все сайты используют Apple Touch Icon. Давайте рассмотрим ситуацию, когда его нет.
Делаем все тоже самое, но на пункте 3 предыдущей инструкции видим такую картину:
Изображение создалось автоматически, но по факту это скриншот верхней части сайта. Вот как Web Clips будет выглядеть на рабочем столе нашего устройства:
Согласитесь, в первом случае он выглядел лучше.
Apple Touch Icon можно отнести к разряду вещей, формирующих узнаваемость вашего бренда. Этой иконкой может быть логотип вашей компании, и он должен привлекать к себе внимание и быть узнаваемым. Если посетитель на рабочем столе будет видеть просто скриншот страницы, это вряд ли положительно скажется на узнаваемости.
Возможна ситуация, что ваш сайт полон интересного контента, и пользователь решит добавить себе на рабочий стол ссылку на него, чтобы как можно чаще и удобней посещать ресурс. Но выглядеть она будет не очень привлекательно.
Чтобы этого избежать, давайте рассмотрим технические особенности создания Apple-touch-icon.png.
Техническая сторона
При создании Web Clips от устройства на сервер будут отправляться запросы в следующем порядке:
- В первую очередь к apple-touch-icon-precomposed.png.
- Если он не найден (от сервера получен ответ 404), то устройство сделает новый запрос к к apple-touch-icon.png.
- Если и этот способ не увенчается успехом, то устройство сделает скриншот верхней части вашего сайта, и он будет использоваться в качестве Web Clips.
Apple-touch-icon-precomposed.png и к apple-touch-icon.png, в чем различия?
Apple-touch-icon.png позволяет создать изображения, не запариваясь с фирменным оформлением Apple (закругленные рамки, блики). Ваше устройство все сделает самостоятельно.
С помощью apple-touch-icon-precomposed.png вы можете проявить некую творческую жилу и сделать все вручную, однако к этому формату есть свои требования – будьте внимательны.
Размеры для apple-touch-icon
В 2007 году было достаточно размера 57×57, так как было только одно устройство, на котором можно было сделать Web Clips.
На сегодняшний день у компании Apple довольно обширная линейка продукции. И чтобы иконка выглядела эстетично на каждом разрешении экрана, без мыльных растянутых пикселей, можно добавить свою иконку.
Если устройство не найдет иконку нужного размера, то оно будет использовать самую близкую по большему размеру иконку.
Необязательно создавать иконки для всех разрешений экранов, достаточно будет сделать иконку размером 180×180, так как другие устройства могут уменьшить размер под свои требования.
Однако не стоит забывать о том, что не только устройства Apple используют Apple Touch Icon, поэтому можно объявить и другие размеры. Указывать размеры нужно с помощью атрибута – sizes.
Таблица размеров
Модель устройства | Размер apple-touch-icon |
IPhone – first generation, iPhone 2G, iPhone 3G, iPhone 3GS | 57×57 |
iPhone 4, iPhone 4s, iPhone 5, iPhone 5c, iPhone 5s, iPhone se, iPhone 6, iPhone 6s, iPhone 7, iPhone8 | 120×120 |
iPhone X, iPhone 8 Plus, iPhone 7 Plus, iPhone 6s Plus, iPhone 6 Plus | 180×180 |
iPad mini | 76×76 |
iPad, iPad mini 2 | 152×152 |
iPad Pro | 167×167 |
На сегодняшний день Apple рекомендует дает следующие рекомендации по размерам иконок
Модель устройства | Размер apple-touch-icon |
iPhone | 120×120 или 180×180 |
iPad Pro | 167×167 |
iPad, iPad mini | 152×152 |
Можно сделать вывод что устройства первого поколения, и ipad mini уже неактуальны, поэтому для них необязательно прописывать Apple-touch-icon соответствующего размера.
Как прописать в коде apple-touch-icon?
Прописывается в вашего сайта. С помощью тега
, по аналогии с favicon.
Для сравнения напоминание, как прописывается фавикон:
Как прописывается apple-touch-icon:
Использование в поисковой выдаче
22 мая 2019 года Google в своем блоге объявили о редизайне мобильной выдачи.Теперь в результатах мобильной поисковой выдачи будет показываться иконка сайта.
И для этой иконки может быть использован как Apple Touch Icon, так и другие форматы к примеру:
Подробнее о требованиях к иконке тут.
Если вы изменили иконку или создали новую, чтобы в выдаче она обновилась как можно скорее, нужно отправить страницу на повторное сканирование.
Как это сделать, написано тут.
Заключение
Прошло уже много лет с тех пор, как появился первый iPhone и соответственно Apple-touch-icon. Теперь он может быть использован не только для оформления красивого Web Clips, но и для улучшения внешнего вида сниппета сайта в поисковой выдаче Google. А Apple Touch Icon со временем популяризировался и теперь используется другими платформами и приложениями.
Мы рассмотрели только часть возможностей для кастомизации сайта, но у Apple есть еще несколько интересных дополнений, например, Startup Image, Apple Mobile Web App Title и другие вещи, о которых расскажем в следующих статьях.
Если у вас на сайте еще нет Apple Touch Icon, обращайтесь к нам за помощью в отрисовке и размещении на сайте – с радостью поможем.
Источник
Apple-touch-icon generator
For Apple iOS devices such as the iPod Touch, iPhone, and iPad, as well as some Android devices, you can provide a custom icon to your visitors that displays on their Home screens when they bookmark your site or «Add to Home Screen» («Web Clip» feature).
This tool wil generate the required html as well as the apple-touch-icons in four sizes (iPhone, iPad, iPhone Retina & iPad Retina), which you can download as .zip
Create Apple touch icons for your site
About Apple touch icons
Similar to the Favicon, the apple-touch-icon.png is a file used for a web page icon on the Apple iPhone, iPod Touch, and iPad. When someone bookmarks your web page or adds your web page to their home screen this icon is used. If this file is not found these Apple products will use the screen shot of the web page, which often looks like no more than a white square.
The tool will output four png’s, with dimensions of 57×57 (iPhone), 72×72 (iPad), 114×114 (iPhone Retina) and 144×144 (iPad Retina). These should be stored in your sites’ home directory, unless the path is specified in the HTML using the below code.
When this file is used, by default, the Apple product will automatically give the icon rounded edges and a button-like appearance (if not ‘precomposed’).
Details and specifications about apple-touch-icon on Apple’s website.
Link to this page: “Apple-touch-icon generator”
You can link to this tool using this HTML code. Simply copy and paste it into your page:
If you have any problems using this Apple-touch-icon generator, please contact me.
Источник
Apple Touch icon for websites
Up to now, I’ve been including the line for the Apple Touch icon in my head like this:
However, in the Q&A «What are the correct pixel dimensions for an apple-touch-icon?» it is stated in the accepted answer that three images are now needed according to Apple’s guidelines.
So how would one go about inserting these into the head section of the code?
8 Answers 8
Minimalist solution — Recommended
A common practice is to create a single 180×180 icon, which is the highest expected resolution, and let the iOS devices scale it down as needed. It is declared with:
Exhaustive solution — Not recommended
Apple specs specify new sizes for iOS7:
In addition, precomposed icons are deprecated.
As a consequence, to support both new devices (running iOS7) and older (iOS6 and prior), the generic code is:
Note that iOS looks for URL like /apple-touch-icon-76×76.png , if it does not find interesting stuff in the HTML code (a bit like what IE is doing with /favicon.ico ). So it is important to keep the file names are they are above. It is also important to consider that Android/Chrome is also using these pictures.
You might want to know that this favicon generator can create all these pictures at once. Full disclosure: I’m the author of this site.
Here you go, hope this helps.
If you want Apple to do the aesthetic bit for you (add the gloss) then you’d put in these to the tags:
If you want to precompose the image, so that Apple displays it without the gloss, then you’d do this:
Providing you include more than one, the iOS device will look for the correct size and utilise that image automatically. As you can see from the names of the images in the example, the iPad with retina display needs an icon which is 144x144px, the iPhone 4/4S/5 needs an icon which is 114x114px, the original iPad (and iPad 2, as the screen resolution is no different) needs an icon which is 72x72px, and the original iPhone doesn’t need a size specification, but for your reference it is 57x57px.
Since a few of these answers are out of date already, I recommend using http://realfavicongenerator.net/ to generate all the images and markup — I donate a couple euros each time I use it in the hope that it enables them to keep up to date as to what is currently valid on iOS, Android & Windows, so I don’t have to.
As of 2018, Apple Developers Website recommends the following for iOS devices:
App Title will replace your website title. Usually, you’d want that. Startup image is what will appear while the app is launching.
Specifying a Webpage Icon for Web Clip
You may want users to be able to add your web application or webpage link to the Home screen. These links, represented by an icon, are called Web Clips. Follow these simple steps to specify an icon to represent your web application or webpage on iOS.
To specify an icon for the entire website (every page on the website), place an icon file in PNG format in the root document folder called apple-touch-icon.png
To specify an icon for a single webpage or replace the website icon with a webpage-specific icon, add a link element to the webpage, as in:
In the above example, replace custom_icon.png with your icon filename. To specify multiple icons for different device resolutions—for example, support both iPhone and iPad devices—add a sizes attribute to each link element as follows:
The icon that is the most appropriate size for the device is used. If no sizes attribute is set, the element’s size defaults to 60 x 60. If there is no icon that matches the recommended size for the device, the smallest icon larger than the recommended size is used. If there are no icons larger than the recommended size, the largest icon is used.
If no icons are specified using a link element, the website root directory is searched for icons with the apple-touch-icon. prefix. For example, if the appropriate icon size for the device is 60 x 60, the system searches for filenames in the following order:
See Icon and Image Sizes for webpage icon metrics.
Источник