<分区>
关闭 4 年前。
- 这个问题是由于打字错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助 future 的读者。
- 编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
<分区>
关闭 4 年前。
我已经建立了一个页面,其中有下面的@media
查询来为移动访客调整大小:
@media all and (max-width: 600px) {
#survey-container {
width: 100%;
font-size: 8px;
}
.input-field {
width: 85px;
}
.input-select {
width: 85px;
}
}
@media all and (max-height: 800px) {
#survey-container {
min-height: 100%;
}
}
input-field
类附加了所有 input
类型为 number
、text
或 email
,input-select
用于下拉输入。但是,我对 Age 的输入不遵循 input-field
的 @media
样式,如下所示:
可以看出,Age 的字段与其他字段的大小不同,尽管由相同的类 input-field
设置样式。
奇怪的是,我可以将字段的宽度
设置为75px
,它们会均匀分布,但我不希望它们是75px
。此外,通过将 input-type
从 number
更改为 text
,它们的大小都将为 85px
,但是Age 输入必须是 number
,因此无法使用该解决方案。
最佳答案
尝试使用:
#survey-container input[type="text"],
#survey-container input[type="email"],
#survey-container input[type="number"],
#survey-container input[type="select"]{
width: 85px;
}
关于html - 数字输入不遵循@media 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55165478/