我在Flex布局中有一些数字输入,这些输入在Firefox中没有像预期的那样大小,我不明白为什么。Firefox与Chrome浏览器奇怪的输入宽度
正如你所看到的,XP行不溢出其在Chrome(没有水平滚动)的父母,但它有显着溢出在Firefox(水平滚动),在数字输入的顶部重叠相邻标签文本。
从网页上的相关HTML CSS &是:
/**
* The ".charsheet" prefix on each rule is automatically added
*/
.charsheet .sheet-flexbox-h input[type=number] {
flex: 1 1 40%;
margin-left: 5px;
}
.charsheet .sheet-flexbox-inline > label > span {
white-space: nowrap;
font-size: 89%;
}
.charsheet .sheet-flexbox-h > label {
width: 100%;
display: flex;
flex-direction: row;
}
.charsheet .sheet-flexbox-inline {
display: inline-flex;
width: 100%;
}
.charsheet .sheet-3colrow .sheet-2col:last-child {
width: calc(66% - 5px);
}
.charsheet .sheet-body {
display: block;
overflow-x: visible;
overflow-y: scroll;
position: relative;
flex: 1 1 auto;
}
.charsheet .sheet-content {
height: 100%;
display: flex;
flex-direction: column;
}
.charsheet {
position: absolute;
left: 0;
height: calc(100% - 70px);
width: calc(100% - 12px);
}
/**
* CSS rules below are on the page, but not editable by me
*/
.ui-dialog .charsheet input[type=number] {
width: 3.5em;
}
.ui-dialog .charsheet input {
box-sizing: border-box;
}
<!-- I can only modify the descendants of .charsheet -->
<div class="charsheet tab-pane lang-en" style="display: block;">
<div class="sheet-content">
<div class="sheet-body">
<!-- ... -->
<div class="sheet-3colrow">
<div class="sheet-col"><!-- ... --></div>
<div class="sheet-2col">
<!-- ... -->
<div class="sheet-flexbox-h sheet-flexbox-inline">
<label>
<span data-i18n="current-experience-points">Current XP:</span>
<input type="number" name="attr_xp">
</label>
<label>
<span data-i18n="total-experience-points">Total XP:</span>
<input type="number" name="attr_xp_max">
</label>
<!-- etc... -->
</div><!-- /sheet-flexbox-h -->
<!-- ... -->
</div><!-- /sheet-2col -->
</div><!-- /sheet-3colrow -->
<!-- ... -->
</div><!-- /sheet-body -->
<div class="sheet-footer"><!-- ... --></div>
</div><!-- /sheet-content -->
</div><!-- /charsheet -->
我全 CSS和HTML可以在Roll20/roll20-character-sheets on GitHub找到。我不能编辑CSS完全可以在Roll20.net
更新进行现场发现(精缩):我创建了一个小提琴来演示该问题:https://jsfiddle.net/Lithl/az1njzn8/
Fiddle in Chrome,fiddle in Firefox
你可以创建一个简单的jsfiddle来重现问题吗?谢谢。 –
@GurtejSingh,今晚晚些时候我可以尝试这样做,尽管我怀疑这个问题可能是由与其他布局的交互引起的,所以我希望能够举个简单的例子。如果任何拥有Roll20帐户(或愿意创建一个帐户)的人想要检查完整版本,那就是Exalted 3e工作表。 –
如果您无法制作小提琴,则可以使用指向示例网站的链接。 –