如何制作手机版网站

发布于 2024-10-04 01:55:21 字数 168 浏览 3 评论 0原文

我正在寻找可以帮助我学习如何设置网站的东西,以便人们访问该网站时可以看到常规版本和移动版本。我遇到的问题是,我在谷歌上看到的大多数网站都是付费网站,可以帮助您进行设置。我可以制作网站的两个版本并将它们都加载到我的主机上吗?另外,它如何知道何时加载移动设备和常规设备?这些是我想要学习的东西类型,有什么建议可以从哪里开始吗?

I am looking for something that will help me learn how to set up my site so that when people go to it there is the regular version and the mobile version. Problem I am having is that most of the sites I see on google are pay sites that help you set that up. Can I just make two versions of my site and load them both on my hosting? Also how does it know when to load the mobile versus the regular? These are the types of things I am looking to learn, any suggestions of places to start?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

醉殇 2024-10-11 01:55:21

请确保您执行以下操作:

  1. 仅在增加价值的情况下使用移动版本。
  2. 如果用户从移动设备请求深层链接,请勿重定向到移动
  3. 主页用户选择查看完整版本
  4. 确保 iPad 等平板电脑默认使用完整版本
  5. 不要向 iPhone 等高分辨率智能手机提供 WML
  6. 如果您的全尺寸网站在手机上无法使用,请考虑对其进行调整更合适(不要打印内容文本太宽)。

现代 iPhone 和 iPad 完全能够处理大多数全尺寸网站,除非它确实改善了用户体验,否则几乎不需要移动版本。我讨厌被重定向到无法提供我需要的信息的婴儿界面。

移动版本的良好示例包括:

  • Google 网站
  • Gmail 网站

平庸的示例包括:

  • 任何 blogpress 网站

不良示例包括

  • 任何使用 WML 的内容

这是 Apple 的 有关为 iPad 提供移动版本的建议

请注意,iPad 上的 Safari 用户
代理字符串包含单词
“移动”,但不包含
“iPhone”这个词。如果您目前是
向任何浏览器提供移动内容
自称为“移动”的,您
应该修改您的用户代理字符串
检查寻找 iPad 并避免
发送给您的错误版本
地点。版本号在这个
字符串可能会随着时间的推移而改变
作为 iPad 上 Safari 的新版本
变得可用,因此任何代码
检查用户代理字符串应该
不依赖版本号。

Please please please make sure you do the following:

  1. Only do a mobile version if it adds value.
  2. If a user requests a deep link from a mobile device, don't redirect to the mobile home page
  3. Allow the user to choose to view the full version
  4. Make sure tablets such as the iPad uses the full version by default
  5. Don't serve WML to the hi-res smartphones such as the iPhone
  6. If your full sized website is unusable on a phone, consider tweaking it to be more suitable (don't print content text too wide).

Modern iPhones and iPads are perfectly capable of handling most full sized websites, there is little need for a mobile version unless it actually improves the user experience. I hate to get redirected to a baby interface that doesn't provide the information I need.

Good examples of mobile versions include:

  • Google website
  • Gmail website

Mediocre examples include:

  • Any blogpress site

Bad examples include

  • anything that uses WML

Here's Apple's advice on providing mobile versions to the iPad:

Note that the Safari on iPad user
agent string contains the word
"Mobile", but does not contain the
word "iPhone". If you are currently
serving mobile content to any browser
that self-identifies as "Mobile", you
should modify your user agent string
checks to look for iPad and avoid
sending it the wrong version of your
site. The version numbers in this
string are subject to change over time
as new versions of Safari on iPad
become available, so any code that
checks the user agent string should
not rely on version numbers.

请别遗忘我 2024-10-11 01:55:21

需要研究的是 @mobile css 媒体类型,它用于在移动设备中加载时加载不同的样式。我不确定哪些设备支持它,但我想大多数流行的型号都会支持它。就您的建议而言,您当然可以托管两个单独的站点,但在您遇到麻烦之前,我会挑衅地仔细阅读亚历克斯的建议。

http://www.w3.org/TR/css-mobile/

Something to look into would be the @mobile css media type, which is used to load a different styles when loading in a mobile device. I am not sure which devices support it, but I imagine it would be most of the popular models. As far as your suggestion, you can certainly host two separate sites, but I would defiantly go through Alex's suggestions before you go through the trouble.

http://www.w3.org/TR/css-mobile/

若水般的淡然安静女子 2024-10-11 01:55:21

Alex 提出了一些很好的建议,但如果您确实想提供基于移动或非移动的特定版本,您可以查看 http 标头。在某些情况下,用户代理会放弃它,但并非总是如此。查看此链接了解详细信息:http://detectmobilebrowsers.mobi/

Alex had some good suggestions, but if you really want to serve up a specific version based on mobile or non-mobile you can take a look at the http header. In some cases the User Agent will give it away, but not always. Check out this link for details: http://detectmobilebrowsers.mobi/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文