【发布时间】:2012-05-15 04:33:14
【问题描述】:
解决了! 原来 body 标签没有 100% 的高度,而是两个宽度设置。 小学生错误,对不起。 这已经解决了。
我只使用网络元素和文本创建了一面美国国旗。
它在 Chrome 中以全彩色呈现良好,但在 Firefox 中仅显示星星和黑体背景。
有人可以强调这里出了什么问题吗?将 Doctype 放在页面上实际上会产生 Firefox 在页面的 Chrome 呈现方面遇到的相同问题。
非常感谢任何帮助。
<html>
<head>
<title>FLAG</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
position: relative;
background: #000;
font-family: Arial, Helvetica, sans-serif;
font-size: small;
color: #fff;
margin: 0;
width: 100%;
width: 100%;
}
a {
text-decoration: none;
color: inherit
}
#star_wrapper {
position: relative;
}
h1 {
line-height:35%;
font-size: 150px;
padding: 5%;
margin-top: 11%;
margin-right: 5%;
margin-left: 5%;
z-index: -1;
}
#foot {
position: absolute;
background: #000;
top: 0px;
width: 100%;
height: 100%;
}
#stripes_wrapper {
height: 100%;
width: 100%;
}
.box {
position: relative;
display: block;
height: 7.692307692307692%;
width: 100%;
}
.red {
background: #B22234;
}
.white {
background: #ffffff;
}
#title_wrapper {
background: #3C3B6E;
height: 53.84615384615385%;
width: 40%;
z-index: 1;
position: absolute;
top: 0;
}
.liner {
z-index: 2;
}
</style>
</head>
<body>
<div id="foot">
<div id="title_wrapper">
<center>
<div id="star_wrapper">
<h1>
* * * * * *<br>
* * * * *<br>
* * * * * *<br>
* * * * *<br>
* * * * * *<br>
* * * * *<br>
* * * * * *<br>
* * * * *<br>
* * * * * *<br>
</h1>
</div>
</center>
</div>
<div id="stripes_wrapper">
<div class="box red"></div>
<div class="box white"></div>
<div class="box red"></div>
<div class="box white"></div>
<div class="box red"></div>
<div class="box white"></div>
<div class="box red"></div>
<div class="box white liner"></div>
<div class="box red liner"></div>
<div class="box white liner"></div>
<div class="box red liner"></div>
<div class="box white liner"></div>
<div class="box red liner"></div>
</div>
</div>
<center>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.fittext.js"></script>
<script src="jquery-outline-1.0.js"></script>
<script>
$("h1").fitText(0.34);
</script>
<script type="text/javascript">
$(document).ready(function(){
$("h1").outlineLetters({color: '#fff', size: 1});
});
</script>
</body>
【问题讨论】:
-
请把代码带到这里(或到 jsfiddle)。否则,当问题得到解决时,指向您标志的链接将无助于理解问题
-
我查看了您的 CSS,看起来您没有任何需要供应商标签的内容。您是否查看过您正在使用的 jQuery 插件,看看它们是否有浏览器限制?
-
标志的高度是 0px,因此所有子元素的高度也都是 0px,因为它们都是基于 % 的。
-
我不认为是插件,我在其他项目的浏览器上对它们进行了大量测试。该站点的主页eda.site50.net/index.html 使用非常相似的设置,但在FF 中呈现良好。 (顺便说一句大slogan,是我和朋友玩的网游)
-
废话,我是个白痴,这是一个
width: 100%; width: 100%;,在body标签中应该是width: 100%; height: 100%;。