gpt4 book ai didi

html - 无法在 HTML 文件中将 Java Applet 居中

转载 作者:太空宇宙 更新时间:2023-11-04 03:24:25 24 4
gpt4 key购买 nike

我需要将我的小程序水平和垂直居中,但我只能水平居中。任何人都可以帮助解决这个简单的 CSS 问题吗?我试过使用“display: inline-block;”和“显示: block ;”但这两者都没有效果。这是我的代码:

<!DOCTYPE html>
<html>
<head>
<title>testing..</title>
<style type="text/css">
html, body {
margin: 0;
}
#container {
width: 640px;
height: 610px;
margin: auto;
}
</style>
</head>
<body>
<div id="container">
<applet code="TetrisApplet.class" width="640" height="610"/>
</div>
</body>
</html>

最佳答案

您可以使用相同宽度的 div 和 applet或者把applet放到new div width display:inline-block;

关于html - 无法在 HTML 文件中将 Java Applet 居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27342314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com