Pac*_*ier 2 html css java applet
大家下午好,
我有一个Java小程序,我希望嵌入一个网站.我要求小程序是全尺寸的,即它占据网页的100%宽度和100%高度.
应该没有滚动条.
这是我目前的代码:
<!doctype html>
<html>
<body style="background:red; width:100%; height:100%; padding:0; margin:0; border:0;">
<applet code="HelloWorld.class" style="padding:0; margin:0; border:0; width:100%; height:100%;">
Your browser does not support the <code>applet</code> tag.
</applet>
<!-- the applet should cover the entire page, so even though the body is red, it should be covered by the applet -->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
出于某种原因,它不适用于FireFox和IE.在Chrome中,小程序看起来比页面本身更高,因此会显示垂直滚动条.我们如何让applet填充网页的确切大小,既不显示任何水平滚动条也不显示垂直滚动条?
PS:如果可能的话,在禁用JavaScript的浏览器上运行的解决方案会很酷.
使用绝对位置.不要指定高度或宽度.
applet {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2440 次 |
| 最近记录: |