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.