javascript - 初始加载时画布网格被压扁,调整网页窗口大小后自动调整为方形网格
问题描述
最初加载网站时,网格是 squashed squashed grid
调整网页窗口大小后,它会自动修复问题 平方网格,但网格会延伸到网页上
进入 css 后,box-sizing 是固有的。如果我删除 box-sizing 属性,则网格是固定的。
以下是网格的 css 代码。
#renderContainer {
z-index: 0;
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
* {
padding: 0;
margin: 0;
}
*, ::before, ::after {
background-repeat: no-repeat;
box-sizing: inherit;
源代码可以在https://github.com/CIDARLAB/3DuF/blob/webpack-build/src/components/Visualiser.vue上找到
样式代码可以在https://github.com/CIDARLAB/3DuF/blob/webpack-build/public/modified.css上找到
html 可以在https://github.com/CIDARLAB/3DuF/blob/webpack-build/public/index2.html上找到
有谁知道为什么会这样?
谢谢!
解决方案
推荐阅读
- kubernetes - 当更改最大/最小副本限制时,水平 pod 自动缩放器如何处理未就绪的 pod
- html - CSS:没有“拉伸”左边框的填充顶部
- python - 使用 reportLab 将页眉和页脚添加到页面
- neo4j - 如何在 docker-compose 文件中的 neo4j 中启用“apoc.nlp.gcp.entities.stream”?
- javascript - ESP 32 AsyncWebServer 下载 .txt 文件?
- httpclient - 错误:调用使用属性错误声明的“HTTPClient::begin”:过时的 API,使用 ::begin(WiFiClient, url)
- reactjs - 从特定路径中的路径获取 id
- arrays - 内部 .map() 样式“this” Compenent (React.js)
- angular - 如何使用服务器端角度在所有页面的数据表中获取动态计数
- javascript - 将自定义 vanilla javascript 函数添加到 webpack-encore 工作流配置