如何使用C#代码修改Css文件类? [英] How to modify Css file class using C# code?
本文介绍了如何使用C#代码修改Css文件类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的css文件名为
sample.css<br />
在该文件中添加了一个类
in that file added one class
.lblcss
{
color:#fff;
boder-color:#ff122;
background color:black;
}
现在我想动态地使用c#代码将颜色改为红色。
你可以帮助我吗?
i意味着如何获取css文件进入cs文件??
并修改??
now i want to change color to red using c# code dynamically.
can you help me??
i mean how get css file into cs file??
and modify??
推荐答案
你可能想看看减少 [ ^ ]
看看f以下文章:
http://www.dotlesscss.org/ [ ^ ]
http://www.brendanforster.com/blog/还有另一个实施少于aspnetmvc-post.html [ ^ ]
http://blogs.msdn.com/b/cdndevs /archive/2014/04/29/refactoring-your-css-with-less-in-visual-studio-web-essentials.aspx [ ^ ]
如果Less不是一个选项,请查看代码背后的粗略方式:
动态设置ASP中CSS文件的链接。 NET [ ^ ]
You might want to look at Less[^]
Look at the following articles to get started:
http://www.dotlesscss.org/[^]
http://www.brendanforster.com/blog/yet-another-implement-less-in-aspnetmvc-post.html[^]
http://blogs.msdn.com/b/cdndevs/archive/2014/04/29/refactoring-your-css-with-less-in-visual-studio-web-essentials.aspx[^]
If Less is not an option, look at the crude way of doing it in code behind:
Dynamically set a link to a CSS file in ASP.NET[^]
请参阅SO上的类似问题:http://stackoverflow.com/questions/1509231/c-sharp-is-there-any-wpf- html-javascript-css-syntax-editor-control [ ^ ]
MSDN: http://forums.asp.net/t/1705501.aspx?how+can+i+make+browser+based+CSS+editor+built+using+asp+net+with+c+ [< a href =http://forums.asp.net/t/1705501.aspx?how+can+i+make+browser+based+CSS+editor+built+using+asp+net+with+c+target = _blanktitle =新窗口> ^ ]
和CSharpCorner: http://www.c-sharpcorner.com/tags/CSS-Editor [ ^ ]
Please, see similar question on SO: http://stackoverflow.com/questions/1509231/c-sharp-is-there-any-wpf-html-javascript-css-syntax-editor-control[^]
MSDN: http://forums.asp.net/t/1705501.aspx?how+can+i+make+browser+based+CSS+editor+built+using+asp+net+with+c+[^]
and CSharpCorner: http://www.c-sharpcorner.com/tags/CSS-Editor[^]
这篇关于如何使用C#代码修改Css文件类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文