html - flex 的 Chrome 显示问题

标签 html css flexbox

我正在使用 display:flex , 我正在处理 ul 元素列表。不知道为什么我得到 2 个不同的结果: chrome 的问题: Browsers_Pic 这就是我想要做的: http://jsfiddle.net/0fbdgfcq/26/

    ul {
    max-width:800px;
    display: flex;
    flex-direction: row-reverse;
    background-color: blue;
    height: 100px;
    max-width: 500px;
    min-width: 100px;
    padding:0;
}

.box{
/* Clean */

}
.g p{
    white-space:nowrap;
    text-align:center;
    color:white;
    text-decoration:none;
    font-size:3vw;
}
.g li {
    flex: 1 0;
    width: 15%;
    height: auto;
    color:white;
    font-size:3vw;
    list-style-type: none;
    word-wrap: break-word;

}
.g img {
    width: 100%;
    height: 100%;
    max-width:100px;
    max-height:100px;

}

最佳答案

副手我会说问题是您应用的 width:15% 覆盖了列表项的 flex 。

尝试

.g li {
    flex: 1 0 15%;
}

JSfiddle

关于html - flex 的 Chrome 显示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34444246/

相关文章:

css - 并排对齐按钮 - bootstrap 3

javascript - 居中图像左上角的叠加元素

html - 实现页脚不会留在底部?

html - 显示 : flex not working in CSS

php - 如何将 PHP 变量值赋给 Javascript 变量?

javascript - 如何使用JavaScript获取父iframe的父iframe?

javascript - 如何通过 CSS 将 Logo 的大小设置为相同?

html - 更改移动设备上的 Bootstrap 顺序 - 3 个不同的框

Flexbox 列重叠

html - 有一个与其父级相同大小的 div (flexbox)