-moz-box-pack
(或 box-pack
)的 justify
属性似乎在 Firefox 中被忽略了。
Live example从我们的网站。每行中的数字应该右对齐,它们在 Chrome 中也是如此。
有什么线索吗?
HTML 和 CSS:
<a class="category_box box_sizing" href="/itunes-store/apps/free-apps/category/all-apps?itunes-store-id=888-36" itunes_id="888-36" path="/36/888-36">
<div class="name">All Apps</div> <div class="num_apps">43</div>
</a>
.page_list .list a {
color: #5C5C5C;
}
.page_list .category_box {
-moz-box-pack: justify;
border-bottom: 1px solid #CCCCCC;
display: -moz-box;
padding: 15px 10px;
width: 100%;
}
.box_sizing {
-moz-box-sizing: border-box;
}
a {
color: #5E87B0;
text-decoration: none;
}
最佳答案
使用以下 css 规则:
.category_box .name {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
}
这应该会产生您想要的结果。
检查 flexbox 布局模式信息,这应该可以帮助您构建您想要的:
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes
http://demo.agektmr.com/flexbox/
希望对你有帮助
关于html - 在 Firefox 中忽略 box-pack (-moz-box-pack) 的 Justify 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20504614/