移动网站设计 [英] Web Site Designing for Mobile
问题描述
我刚刚使用样式表(例如@media print等等)向网站添加了打印功能,并想知道是否可以使用类似的方法添加对移动设备的支持。
I just added printing capability to a web site using a style sheet (ie. @media print, etc.) and was wondering if I could use a similar method for adding support for mobile devices.
如果没有,如何检测移动设备?我的网页是C#(.aspx),我想缩小页面以方便在移动设备上使用。
If not, how do I detect a mobile device? My pages are C# (.aspx) and I'd like to scale back the pages for ease of use on a mobile device.
对我有什么建议?
编辑:我的妻子有一个黑莓,所以在一个miminum我想启用我们公司的网站。
My wife has a BlackBerry, so at a miminum I'd like to enable our company's web site for that.
推荐答案
我不知道IPhone / iPod Touch在请求样式表时如何声明自己,但对大多数人来说,使用
I'm not sure how the IPhone/iPod Touch declare themselves when requesting the stylesheet, but for most, using
<style type="text/css">
@media handheld
{
/* handheld styles */
}
</style>
它的工作方式与@media print(或不是)相同。
should do the trick. It works in the same way @media print does (or doesn't).
有关媒体类型的完整列表,请参阅这里。
For a complete list of media types, see here.
这篇关于移动网站设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!