问题描述
我没有找到解决此问题的方法:我想在html-iframe中显示我的playN-game:
I don't find a solution for this issue:I want to show my playN-game in a html-iframe:
<iframe src="../playn-showcase-html/Showcase.html"
width="640" height="480" name="Showcase" scrolling="no" marginwidth="0px" marginheigth="0px" frameborder="0" align="top">
</iframe>
我想无边界地嵌入它.但是,如您在下图中所看到的,我不想在iframe的顶部有一个15像素的黑色矩形".
I want to embedd it with no borders. But as you can see in the image below, there is a 15px black 'rectangle' on top of the iframe I don't want to have.
可以看到的是Showcase.html(黑色)的背景.
What one can see is the background of Showcase.html (which is black).
正如我在Mozilla Firebug中看到的那样,黑色的矩形"是身体元素的一部分.画布对象位于顶部下方15像素处.
As i can see in Mozilla Firebug, the black 'rectangle' is part of the body-element.The canvas-object is located 15px below the top.
如何更改代码,以便使画布对象从顶部开始?
How can I change the code so that the canvas-object starts on top?
下面是Showcase.html的代码:
Below is the code for Showcase.html:
<!DOCTYPE html>
<html>
<head>
<title>PlayN Showcase</title>
<style>
@font-face {
font-family: "Museo";
src: url(showcase/text/Museo.ttf);
}
</style>
</head>
<body bgcolor="black">
<script src="showcase/showcase.nocache.js"></script>
</body>
</html>
推荐答案
您是否尝试向主体元素添加style ="margin:0; padding:0"?
Did you try adding style="margin:0; padding:0" to the body element?
这篇关于PlayN画布对象不在页面顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!