将我的 O3D 画布居中

发布于 2024-08-04 17:31:48 字数 36 浏览 1 评论 0原文

我想要一个居中的 O3D 画布。谁能建议我如何做到这一点?

I would like to have a centered O3D canvas. Can anyone suggest how I might do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑白记忆 2024-08-11 17:31:48

而不是写:

<div id="o3d" style="width: 600px; height: 600px;"></div>

你写:

<div id="o3d" style="width: 600px; height: 600px; margin:0 auto;"></div>

O3D 将自身插入到 id 以“o3d”开头的 div 中。您应用于 div 的任何样式本质上都会应用于 O3D 对象。 margin:0 auto; 只是意味着您想要 0 垂直边距并且您想要平衡的水平边距。

Instead of writing:

<div id="o3d" style="width: 600px; height: 600px;"></div>

You write:

<div id="o3d" style="width: 600px; height: 600px; margin:0 auto;"></div>

O3D inserts itself into the div's that have id's starting with "o3d". Any styling that you apply to the div, is essentially applied to the O3D object. margin:0 auto; just means that you want 0 vertical margin and you want balanced horizontal margin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文