本文介绍了如何通过本地存储更改css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨大家好, 我正在建立一个门户网站,它有两个选项作为链接 - 1)高对比度颜色 2)重置为默认值 为此我制作了两个css--一个用于默认颜色,另一个用于高对比度颜色。 我想要什么时候用户点击选项将适用于所有页面的任何选项,直到他退出或单击其他选项。 任何人都可以告诉我如何实现这一目标。 我只是在寻找html的本地存储内容,但我没有得到如何实现它。在此先感谢。 htmlcode- 高对比度 重置为默认颜色 功能changeColors(newCSS) { document.getElementById(currentCSS)。href = newCSS; }Hi Guys,I am working on a portal which has two option as links-1) high contrast color2) reset to defaultFor this I have made two css-- one for default colors and other for high contrast colors.I want when a user click on any option that option will work for all the pages till he either logs out or click the other option.Can anyone tell me how can I achieve this.I am just looking for the local storage stuff of html, but I am not getting how to implement it. Thanks in advance.htmlcode- High Contrast Reset to default colors function changeColors(newCSS){document.getElementById("currentCSS").href = newCSS;}推荐答案 这篇关于如何通过本地存储更改css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-22 13:06
查看更多