How do I give my web sites an icon for iPhone?

2019-03-22 17:12发布

How do I set the icon that appears on the iPhone for the web sites I create?

5条回答
混吃等死
2楼-- · 2019-03-22 17:34

Add this in your head section:<link rel="icon" href="/your-icon-url"/>

查看更多
一纸荒年 Trace。
3楼-- · 2019-03-22 17:35

And for the sake of completeness, a link to Scott Hanselman's posting, which contains some additional tips as well:

Add Home Screen iPhone Icons and Adjust the ViewPort

查看更多
家丑人穷心不美
4楼-- · 2019-03-22 17:48

From the Apple Developer Connection Safari Web Content Guide for iPhone page Specifying a Webpage Icon for Web Clip...

The user can add a 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 iPhone.

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:

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

In the above example, replace custom_icon.png with your icon filename.

See "Create an Icon for Your Web Application or Webpage" in iPhone Human Interface Guidelines in iPhone Human Interface Guidelines for webpage icon metrics.

Note: The web clip feature is available in iPhone 1.1.3 and later.

查看更多
混吃等死
5楼-- · 2019-03-22 17:50

I've made a suggestion that Stack Overflow implement an apple-touch-icon:

Add an apple-touch-icon for Safari on iPhone

查看更多
神经病院院长
6楼-- · 2019-03-22 17:53

See the Specifying a Webpage Icon for Web Clip section of the Configuring Web Applications page of the Safari Web Content Guide in the Safari Reference Library...

Specifying a Webpage Icon for Web Clip

iPhone OS Note: The Web Clip feature is available in iPhone OS 1.1.3 and later. The apple-touch-icon-precomposed.png filename is available in iPhone OS 2.0 and later.

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 iPhone OS.

  • 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 or apple-touch-icon-precomposed.png. If you use apple-touch-icon-precomposed.png as the filename, Safari on iPhone OS won’t add any effects to the icon.

  • 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:
    <link rel="apple-touch-icon" href="/custom_icon.png"/>
    In the above example, replace custom_icon.png with your icon filename. If you don’t want Safari on iPhone OS to add any effects to the icon, replace apple-touch-icon with apple-touch-icon-precomposed.

See "Create an Icon for Your Web Application or Webpage" in iPhone Human Interface Guidelines for Web Applications for webpage icon metrics.

查看更多
登录 后发表回答