如何从母版页为所有相同的id标签设置css类? [英] How to set css class for all same id labels from master page?

查看:166
本文介绍了如何从母版页为所有相同的id标签设置css类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



在我的网络应用程序中,我有近50页。在我的大多数页面中有许多相同ID的标签,例如lblmessage,lblError,lblSucess lblfailed



现在我想为这个标签设置一个css clas应用程序。

因此,我想知道是否有任何方式可以从主页中获取此ID,因为我知道这些ID几乎在所有网页上都是相同的页面和设置css类一次..



请建议..

Hi Team ,

In my web applications i have almost 50 pages . And There are many labels of same ids in my most pages such as lblmessage, lblError, lblSucess lblfailed

Now i want to set one css clas for this labels through out the application.
So insted of going through each page and make changes i was wondering if there is any way where i woudld fetch this id from master pages as i know these ids name which is same on almost all web pages and set css class at once ..

Please suggest ..

推荐答案

当你有一个母版页,所以很容易。



在母版页中链接一个外部CSS文件。在那个CSS文件中,只需写下面的类......

As you are having a Master Page, so it will be easy.

Link one External CSS file in Master Page. In that CSS file, just write classes like below...
#lblmessage, #lblError, #lblSucess
{
    /*All CSS properties.*/
}



这将帮助您定义具有上述ID的所有标签的CSS属性。



如果您需要单个标签的CSS,那么您也可以这样做。


This will help you to define CSS properties for all the Labels having the above ids.

If you need individual CSS for individual Label, then you can also do that.


这篇关于如何从母版页为所有相同的id标签设置css类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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