开发者

How to create a global stylesheet for my ASP.NET web app?

开发者 https://www.devze.com 2023-01-24 12:33 出处:网络
I want to control the look and feel of my site by having two css files. One for colors and one for everything else. I want to put the colors css file in the App_Themes folder but I want to add the oth

I want to control the look and feel of my site by having two css files. One for colors and one for everything else. I want to put the colors css file in the App_Themes folder but I want to add the other file to every page on my site, but not add it to App_Themes because I want it to be loaded regardless of what Theme I am using.

Is there a way to ad开发者_C百科d a reference in Web.Config for the global css file? I already have a reference to the styleSheetTheme for my css file with the colors in.

Thanks


Use a master page for all your pages and include the stylesheet in the master page.


If you're using master pages, you can put the CSS in the \App_Themes\file.css, then in the tag, include it specifically.


You can use nested master pages. One "common.master" which includes the common CSS file and therefore it will be added on all pages. Then another master page "theme.master" which will add only the colors css file.

0

精彩评论

暂无评论...
验证码 换一张
取 消