html - 车身造型无缘无故停在一个屏幕上
问题描述
我在body
元素上的样式恰好在我的计算机“第一个屏幕”停止的地方停止。似乎没有与代码相关的原因:
// Styled JSX react.js library:
body {
font-size: calc(14px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));
background-color: wheat;
border: 2px dashed green;
}
我不相信 HTML 有任何会导致 body CSS 停止的东西:
<label htmlFor="lowQuantityThreshold">
Enter a stock amount at which this rule will activate an override percentage for any product not marked as an
exclusion (or leave blank to disable this rule)
</label>
<input type="number" />
<label htmlFor="minQuantityPercentage">
</label>
</section>
<section>
<h4>Individual Product Rules</h4>
<p>Set a specific trade in price point and product ID here. Individual product rules override all global
rules.</p>
有谁知道这是怎么回事?
更新
正如评论中所要求的,这里是完整的 CSS:
<style jsx global>{`
html, body { height : 100% !important; }
body {
font-size: calc(14px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));
background-color: wheat;
border: 2px dashed green;
}
p, h1, h2, h3, h4, h5, h6 {
font-family: Roboto, Helvetica, sans-serif;
color: rgba(30, 30, 30, .9);
}
button {
color : whitesmoke;
padding-top: 4px;
padding-bottom: 4px;
}
section {
margin: 2vh 2vw;
padding: 2vh 2vw;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
border-radius: 2px;
}
section > * {
padding: 1vh .5vw;
}
h3 {
font-size: calc(26px + (38 - 14) * ((100vw - 300px) / (1600 - 300)));
}
h4 {
font-size: calc(18px + (28 - 14) * ((100vw - 300px) / (1600 - 300)));
}
h5 {
font-size: calc(20px + (32 - 14) * ((100vw - 300px) / (1600 - 300)));
}
table * { text-align: center; }
button {
border: none;
border-radius: 2vw;
cursor: pointer;
background-color: #5c6ac4;
}
input[type=text], input[type=number] {
padding: 1vh 1vw;
min-width: 200px;
max-width: 400px;
}
.inputRow {
display : grid;
grid-gap: 1rem;
grid-template-columns: repeat(auto-fit, minmax(50px, 200px));
justify-items: center;
align-items: center;
border: 2px dashed red;
}
.formEmulationGrid {
display : grid;
grid-gap : 1rem;
grid-template-columns : repeat(auto-fill, minmax(200px, 1fr))
}
`}</style>
解决方案
按照@epascarello 的建议,我取消选中检查元素上的每个框并将问题追溯到两件事
height : 100%;
我最近在html, body
.- 另一个
height : 100%
通过图书馆进入(shopify/polaris)
删除这两个解决了这个问题。
推荐阅读
- karate - 如何在空手道 API 测试中使用正则表达式验证模板中的响应结构
- amazon-web-services - Route53 不会传播到 Elastic Beanstalk
- centos - 如何使用 cephFS 将 Docker 服务部署到 swarm?
- android - 在 Android 项目上初始化过滤器“drawtext”时出现 FFMpeg 错误
- php - 如何使用 Xpath 抓取 Url
- php - .htaccess:此处不允许的选项 cwp
- android - 带有 PageRow 的leanback BrowseFragment 的自定义标题
- numpy - 将 2D 重塑为 4D 数组
- regex - 在 Fluentd 中查找两个正则表达式的匹配项
- php - 删除数组 PHP 中的数组 0