css - 渲染器之上的 THREE.js html 仅在动态生成组件时才有效
问题描述
在网站中使用 THREE.js 时,每当我制作这样的元素时:
<p style='color:white;position:absolute;left:10px;top:10px;'></p>
元素总是出现在渲染器之前或之后,而不是在顶部。但是,当我动态生成组件时,如下所示:
var sun = document.createElement('div');
sun.className = 'sun';
sun.id = 'sun';
sun.style.right = window.innerWidth/2+'px';
sun.style.top = '100px';
sun.style.position = 'absolute';
它按我想要的方式放置,
任何帮助表示赞赏
解决方案
推荐阅读
- flutter - Flutter:GraphQL 未处理异常:NoSuchMethodError:getter 'host' 被调用为 null
- sql-server - T-SQL:远程存储过程结果有时为空
- python - Python替换功能也没有按预期工作
- angular - 如何在 PdfMake 中传递数组以制作表格
- ruby-on-rails - Searchkick Elasticsearch - 如何使用运算符 - 和/或短语查询?
- git - 在一个分支中完成两个不同分支的更改
- haskell - 使用 optparse-applicative 制作“可选”解析器并为递归数据类型构造值
- python - 如何将宝藏数据查询的结果放入熊猫数据框中?
- php - 如何调试 Codeigniter 4
- python - 在python中如何将str从其他类输出到pyqt textBrowser