如何使用asp.net 2010在asp.net移动控件中应用外部样式表(.CSS) [英] how to apply external style sheet(.CSS) in asp.net mobile controls using asp.net 2010

查看:76
本文介绍了如何使用asp.net 2010在asp.net移动控件中应用外部样式表(.CSS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Asp.net 2010开发移动应用程序。我想在移动应用程序中使用外部CSS文件。我知道如何使用移动样式表,但我不想使用StyleSheets。

I am developing mobile application using Asp.net 2010. I want to use external CSS file in mobile application. i know how to use mobile Stylesheet but i dn`t want to use StyleSheets.

推荐答案

如果您不想使用 Mobile StyleSheets ,然后链接 css 定义 media =掌上电脑的文件,如下所示...... 关于媒体属性的更多信息 [ ^ ]。

If you don't want to use Mobile StyleSheets, then link css files defining media="handheld" like below... More about media Attribute[^].
<link rel="stylesheet" href="css/handheld.css" type="text/css" media="handheld" />





参考 - 为您的网站设计移动样式表 [ ^ ]。br />



Refer - Designing a Mobile Stylesheet for your Website[^].

Quote:

CSS的力量



幸运的是,CSS是一种适用于样式网站的许多领域的强大语言。结构化与移动设备兼容的样式,以及一系列页面结构选项,这是一项简单的工作。

The Power of CSS


Lucky for us CSS is a powerful language applicable to many areas of styling websites. It’s a simple job to structure styles compatible with mobile devices only, along with a slew of options for how pages are structured.

下面是一些简单的代码,您可以添加到您的站点允许外部CSS样式表。请注意,媒体类型设置为掌上电脑,这是解析移动样式的权威因素。

Below is some simple code you can add to your site to allow for an external CSS stylesheet. Notice the media type set to "handheld" which is the definitive factor for parsing mobile styles.

<link rel="stylesheet" href="css/handheld.css" type="text/css" media="handheld" />

此样式表位于:只有当您的网站被移动浏览器解析时,才会加载tachment。这是一项非常宝贵的技术,不需要很长时间就可以实现,并且可以吸引最多的访问者。

This stylesheet attachment will only load when your site is parsed by a mobile browser. This is an invaluable technique that doesn’t take long to implement and will catch the largest majority of your visitors.

过去需要一些花哨的JavaScript数据管理才能确定您的访问者正在运行的浏览器类型并相应地显示CSS样式。随着我们的标准的增长,它使开发人员的工作变得更加简单。您可以将.css文件重命名为您想要的任何内容,上述链接元素的唯一关键方面是媒体属性。

It used to require some fancy JavaScript data management to determine what type of browser your visitors were running and display CSS styles accordingly. As our standards grow it makes the developers job that much simpler. You can rename your .css file to anything you’d like, the only key aspect of the above link element is the media attribute.


这篇关于如何使用asp.net 2010在asp.net移动控件中应用外部样式表(.CSS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆