Shadowbox.js:黑色背景上的黑色文本,窗口加载时带有欢迎消息

发布于 2024-08-23 09:12:04 字数 1140 浏览 6 评论 0原文

我正在使用 Shadowbox.js 示例代码 显示带有消息的阴影盒“该网站还在建设中!”页面加载时:

<link rel="stylesheet" type="text/css" href="shadowbox.css">
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true
});

window.onload = function() {

    // open a welcome message as soon as the window loads
    Shadowbox.open({
        content:    '<div id="welcome-msg">This site is still under construction!</div>',
        player:     "html",
        title:      "Welcome",
        height:     350,
        width:      350
    });

};
</script>

问题是“该网站仍在建设中!”文本以黑色字体显示在黑色背景上。

我认为我必须摆弄我的 CSS,所以我添加了:

div.welcome-msg{font-size:12px;padding:10px;text-align:center;color:white;}

./shadowbox/shadowbox.css,但这并没有解决问题。

有人可以告诉我如何更改“此网站仍在建设中!”的字体颜色吗?文字变成白色?

提前致谢

I am using the Shadowbox.js example code to show a shadowbox with the message "This site is still under construction!" on page load:

<link rel="stylesheet" type="text/css" href="shadowbox.css">
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true
});

window.onload = function() {

    // open a welcome message as soon as the window loads
    Shadowbox.open({
        content:    '<div id="welcome-msg">This site is still under construction!</div>',
        player:     "html",
        title:      "Welcome",
        height:     350,
        width:      350
    });

};
</script>

The problem is that the "This site is still under construction!" text is displayed in a black font on a black background.

I assume that I have to fiddle with my CSS, so I added:

div.welcome-msg{font-size:12px;padding:10px;text-align:center;color:white;}

to ./shadowbox/shadowbox.css, but that didn't solve the problem.

Can someone tell me what I have to do to change to font color of the "This site is still under construction!" text to white?

Thanks in advance

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

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

发布评论

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

评论(2

逆光飞翔i 2024-08-30 09:12:04

尝试使用“div#welcome-msg”代替“div.welcome-msg”。

Instead of "div.welcome-msg" try "div#welcome-msg".

临风闻羌笛 2024-08-30 09:12:04

.welcome-msg{font-size:12px;padding:10px;text-align:center;color:white;} 应该可以在你的 CSS 中工作,只要你有 class="welcome -msg" 代表你的元素。

.welcome-msg{font-size:12px;padding:10px;text-align:center;color:white;} should work in your CSS as long as you have class="welcome-msg" for your element.

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