无法更改sphinx_rtd_theme侧边栏的文本颜色

发布于 2025-01-30 04:43:47 字数 336 浏览 1 评论 0原文

我正在尝试自定义使用sphinx_rtd_theme创建的文档。默认主题具有背景颜色黑色和文本颜色白色的侧边栏。我已经成功地将侧边栏的背景颜色从使用黑色的白色更改为白色

/* Sidebar header (and top-bar for mobile) */
.wy-side-nav-search, .wy-nav-top {
    background: #fafafa;
}

/* Sidebar */
.wy-nav-side {
    background: #fafafa;
}

,但无法找到合适的类或元素以将侧边栏的文本颜色从白色更改为黑色,因此我在白色背景上可以看到它。

I'm trying to customize the docs created using sphinx_rtd_theme. The default theme has a sidebar of background colour black and text colour white. I've successfully changed the background colour of the sidebar to white from black using

/* Sidebar header (and top-bar for mobile) */
.wy-side-nav-search, .wy-nav-top {
    background: #fafafa;
}

/* Sidebar */
.wy-nav-side {
    background: #fafafa;
}

but unable to find the right class or element for changing the text colour of the sidebar to black from white so that it's visible on the white background which I've done.

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

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

发布评论

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

评论(1

层林尽染 2025-02-06 04:43:47

如果您需要更改特定的类并很难找到需要更改哪些CSS属性,则使用浏览器上的Inspector检查网站,将帮助您确定特别需要哪个类/ID。

右键单击要查看的区域,然后单击“检查”,然后您可以查看页面正在使用的所有元素。

If you need to change a specific class and having a hard time finding which css attributes you need to change, by inspecting your website using inspector on your browser will help you identify which class/id specifically you need.

Right click on the area you want to see then click inspect then you will be able to see all the elements that the page is using.

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