使用xml中包含的样式表将样式应用于html页面 [英] Applying styles to html page using stylesheets included in xml
本文介绍了使用xml中包含的样式表将样式应用于html页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个主题切换器,用户可以通过单击按钮来更改网站主题。我不想使用本地存储或cookie。我正在尝试使用xml。我可以将样式表附加到xml文件并运行html。但这会强制xml文件中的样式更改。 HTML页面不会改变。我该怎么做呢请帮忙。
(ASP.net框架)
提前谢谢
I'm trying to create a theme switcher using which user can change website themes by clicking buttons. i don't want to use either local storage or cookies. i'm trying to do it using xml. i can attach stylesheet to a xml file and run the html. but this forces style changes in xml file. html page doesn't change. how do i go about it. pls help.
(ASP.net framework)
Thanks in advance
推荐答案
请看我的文章在哪里我演示了可能最简单的方法:
基于HTML5本地/会话存储的主题选择器:最简单的可思考的 。
请注意所需的Web存储功能与HTML5无关:
http://www.w3.org/TR / webstorage ,
http://en.wikipedia。 org / wiki / Web_storage 。
-SA
Please see my article where I demonstrated probably the simplest possible method:
Theme Selector Based on HTML5 Local/Session Storage: The Simplest Thinkable One.
Note that required Web storage feature is not really related to HTML5 anymore:
http://www.w3.org/TR/webstorage,
http://en.wikipedia.org/wiki/Web_storage.
—SA
这篇关于使用xml中包含的样式表将样式应用于html页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文