C#-根据HTML代码读取CSS中的值 [英] C# - Reading values in CSS acoording to HTML code

查看:369
本文介绍了C#-根据HTML代码读取CSS中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在用C#进行一个学校项目.我有一个部分,其中有一个包含文本和CSS标记的HTML代码,文本属性(作为字体颜色...)随CSS标记值的变化而变化.
我想给用户一个选项,可以在css文件中输入新值.
我该怎么做??

谢谢,
Plony

Hi,

I am woking on a school project in C#. I have a section where i have a HTML code containg text and CSS tags, the text properties(as font color...) is changed occurding to the CSS tag values.
I want to give the user an option to enter new values in to the css file.
How do i do that???

Thanks,
Plony

推荐答案

有很多方法可以做到,从简单到复杂.现在可能最简单的方法是,使用一个带有占位符的模板CSS文件,该占位符表示可以更改的值,然后根据用户选择替换这些值-然后,此CSS文件将写在当前文件的顶部.
There are many ways to do this, ranging from the simple to the complex. Possibly the simplest way for you right now would be to have a template CSS file with placeholders for the values that can change, and then replace those values based on the user selection - this CSS file would then be written over the top of the current one.


我明白这一点,但是我的问题是如何?
如何在特定位置重写CSS文件?根据用户输入?
I understand that, but my question is how??
How do i rewrite a CSS file in specific places? according to USER inputs???


这篇关于C#-根据HTML代码读取CSS中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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