更改 webView 中的文本颜色

发布于 2024-09-04 11:49:46 字数 47 浏览 3 评论 0原文

有没有办法改变整个 webView 的文本颜色? 如果是的话你能给我一些例子吗?

Is there a way to change the text color for entire webView?
If it is could you provide me with some examples?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尬尬 2024-09-11 11:49:46

Web 视图显示网页,因此请按照与任何网页相同的方式进行操作:定义 CSS 样式(内联或在外部引用的样式表中):

* {
color: #FFFFFF;
}

...然后将使用所有文本呈现页面指定的颜色。这是有效的,因为 * 选择器适用于所有元素color 属性指定文本颜色

A web view displays a web page, so do it the same way you would do it for any web page: define a CSS style (inline or in an external, referenced stylesheet):

* {
color: #FFFFFF;
}

... then the page will be rendered with all text the designated color. This works because the * selector applies to all elements and the color property specifies the text color.

昇り龍 2024-09-11 11:49:46

这可以通过 javascript 轻松实现

It's easily doable from javascript

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文