Add the website to the iPhone's home screen and the iphone's home screen

Source: Internet
Author: User

Add the website to the iPhone's home screen and the iphone's home screen

I have an article about how to fix a website to the Start Menu of Windows and customize icons, colors, and Windows push notifications. In fact, Apple has similar functions, by adding a link tag to the head of a Web page, you can easily add a website to the iPhone's home screen in Safari to make it look like a normal app.

To implement this function, you only need to place a file named"Apple-touch-icon.png"Image, just like adding favicon (put the icon" favicon. ico "in the root directory of the website, the browser will automatically load and display the website icon ).

If you need precise control, add the following code:

1. Add the following code in the head section of the webpage. The href attribute value is the image path.

<link rel="apple-touch-icon" href="/custom_icon.png"/>

2. to achieve the Display Effect of devices with different resolutions, you can add three images with different resolutions: 57x57 pixels for the first three generations of iPhone and iPod Touch, 72x72 pixels for iPad, 114x114 pixels are used for subsequent products such as iPhone 4 and iPod Touch that use Retina display. Control by sizes attributes:

<link rel="apple-touch-icon" href="touch-icon-iphone.png" /><link rel="apple-touch-icon" sizes="72x72" href="touch-icon-ipad.png" /><link rel="apple-touch-icon" sizes="114x114" href="touch-icon-iphone4.png" />

3. In addition, modify the rel attribute value"Apple-touch-icon-precomposed"To avoid iOS adding a highlighted effect to the icon.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.