这个额外的底部边界/填充来自哪里?

时间:2015-08-18 17:04:43

标签: html css anychart

我们使用非常简单的页眉/正文/页脚布局:

...
<body>
<div id="container">
<div id="head">[header content goes here]</div>
<div id="body">[content goes here]</div>
<div id="foot">[footer content goes here]</div>
</div>
</body>
...

然后css确保页脚始终位于底部:

html, body {margin:0;padding:0;height:100%;}
#container {min-height:100%;position:relative;}
#body {padding:10px;padding-bottom:2em;zoom:1;}
#head {padding:10px;}
#foot {position:absolute;bottom:0;width:100%;height:1em;}

这非常有效...直到我们向页面添加AnyChart图表,即。我们这样做的那一刻,而不是在页面底部的页脚,有一个空白条纹,与页面底部的页脚高度完全相同,然后页脚在上方空白的条纹。

这是在使用&#34; wide&#34;的页面上出现的问题。 stylesheet,它使用浏览器的完整宽度作为内容: Extra bottom border with no background image

这就是使用&#34;漂亮&#34;的页面上的样子。样式表,添加背景图像和侧边距,让所述图像显示: Extra bottom border with background image

我可以通过在#container上设置负边框底部来缩小空间,但我真的想知道它来自哪里,所以我可以修复错误而不是处理症状。

我无法使AnyChart咳出版本信息。我知道它不是最新版本:它仍然使用广泛的xml,用于模板和图表数据,而我相信最新版本主要转移到JSON(或类似的东西)。在我们的版本中,我们添加了AnyChart.jsAnyChartHTML5.js的链接,然后执行这样的操作来定义图形(使用VBScript的经典ASP,如果有人关心的话):

<%
chartData = "<anychart><templates path=""../js/AnyChartTemplates.xml""/>"
chartData = chartData & "<charts><chart template=""relbar"">"
chartData = chartData & "<data><series><point name=""Question 1"" y=""4.5"" />"
chartData = chartData & "<point name=""Question 2"" y=""8.23"" />"
...
chartData = chartData & "</series></data><chart_settings>"
chartData = chartData & "<axes><y_axis><scale maximum=""10"" /></y_axis></axes>"
chartData = chartData & "</chart_settings></chart></charts></anychart>"
%>
<div id="mychart"></div>
<script type="text/javascript" language="javascript">
    AnyChart.renderingType = anychart.RenderingType.SVG_PREFERRED;
    var chart = new AnyChart("../swf/Chart.swf");
    chart.setData('<%=chartData%>');
    chart.write("mychart");
</script>

同样,我想强调一下,样式在每个没有AnyChart图形的页面上都能完美运行,所以问题必然在于AnyChart所做的事情。我知道此版本的AnyChart存在其他错误,例如如果你在一个页面上有多个图表,它会添加一个它试图隐藏的iframe元素,但是这样做会失败(作为一种解决方法,我们的AnyChart css有一行iframe {display:none;},&# 39;只要我们不想在与图表相同的页面中实际使用iframe,就会工作。我希望有人知道AnyChart添加的其他多余元素或样式会导致底部边距效应,所以我可以隐藏它或禁用它。

0 个答案:

没有答案
相关问题