Shadowbox.js:黑色背景上的黑色文本,窗口加载时带有欢迎消息
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用“div#welcome-msg”代替“div.welcome-msg”。
Instead of "div.welcome-msg" try "div#welcome-msg".
.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 haveclass="welcome-msg"
for your element.