狮子滚动条颜色

发布于 2024-11-25 06:25:24 字数 265 浏览 3 评论 0原文

Lion 中的滚动条似乎基于 HTML 的背景颜色(较浅的颜色 BG = 黑色滚动条,较深的 BG = 白色)。

我遇到的问题是(我认为)关于页脚的常见技巧。我通常将 HTML 元素的背景颜色设置为页脚的颜色,这样,如果页面比浏览器窗口短,页脚似乎会继续(因为 BODY 元素结束,然后 HTML 元素显示直到结束)页面)。但是,这样做会使滚动条基于页脚的颜色,而不是内容区域的颜色。

当页面比窗口短时,是否还有其他技巧可以使页脚继续,或者强制使用 Lion 滚动条的颜色(ick)?

The scrollbars in Lion seem to be based on the HTML's background color (lighter color BG = black scrollbars, darker BG = white).

The problem I'm running into is from what (I assume) is a common trick regarding footers. I usually set the background color for my HTML element to be the footer's color, that way if the page is shorter than the browser window the footer appears to continue on (since the BODY element ends and then the HTML element is what shows until the end of the page). Doing this, however, leaves the scrollbar based on the footer's color, not the content area's color.

Are there any other tricks to make footers continue when the page is shorter than the window, or anyway to force the color of Lion's scrollbars (ick)?

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

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

发布评论

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

评论(2

最佳男配角 2024-12-02 06:25:24

我刚刚遇到了同样的问题,但这似乎解决了。虽然我还没有用其他浏览器彻底测试过它。这是我修复它的方法。

html {
  background: #151515;
}
body {
  background: #FFF;
}

我将想要填充页面其余部分的背景颜色设置为 html 背景颜色,并将正文背景颜色设置为白色,以欺骗 Safari 渲染深灰色滚动条。希望这有帮助!

I just had the same problem, but this seems to solve it. Although I haven't thoroughly tested it with other browsers yet. Here is how I fixed it.

html {
  background: #151515;
}
body {
  background: #FFF;
}

I set the background color I wanted to fill the rest of the page as the html background color, and set the body background color to white to trick Safari to render the dark grey scroll bar. Hope this helps!

獨角戲 2024-12-02 06:25:24

我可能建议使用粘性页脚技术。这会将页脚粘贴到底部,并允许您同时更改背景颜色。

或者,如果您不希望页脚粘在底部,您可以创建一个窗口高度为 100% 的容器(有很多可能性可以实现这一点)并向容器应用背景颜色和 html 不同的背景颜色

I might suggest to use the sticky footer technology. That will stick the footer to the bottom and will allow You to change the background-color in the same time.

Or, if You don't want Your footer to stick to the bottom, You could create a container, with 100% height of the window (there are lot's of possibilities to achieve this out there) and apply a background-color to the container and a different background-color to the html

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