html,带有中心div的css。火狐谷歌, Chrome 不好

标签 html css google-chrome firefox

我有 6 个按钮, 它们在 Firefox 中看起来不错。但它们在 chrome 中的对齐方式不佳。 有人知道如何解决这个问题吗?

#test {
        text-align: center;
    }
<div id="test">
    <button><img src="http://lorempixel.com/99/99"   width="100" height="100"/></button>
    <button><img src="http://lorempixel.com/100/100" width="100" height="100"/></button>
    <br/>
    <button><img src="http://lorempixel.com/101/101" width="100" height="100"/></button>
    <button><img src="http://lorempixel.com/103/103" width="100" height="100"/></button>
    <br/>
    <button><img src="http://lorempixel.com/98/98"   width="100" height="100"/></button>
    <button><img src="http://lorempixel.com/102/102" width="100" height="100"/></button>
    </div>

最佳答案

最后一个 br 是 chrome 的问题。一个快速的解决方法是在底部添加一个

演示

https://jsfiddle.net/4mL8becz/

HTML

<div id="test">
    <button><img src="" width="100" height="100" /></button>
    <button><img src="" width="100" height="100" /></button>
<br>
    <button><img src="" width="100" height="100" /></button>
    <button><img src="" width="100" height="100" /></button>
<br>
    <button><img src="" width="100" height="100" /></button>
    <button><img src="" width="100" height="100" /></button>
<br>
</div>

关于html,带有中心div的css。火狐谷歌, Chrome 不好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30423636/

相关文章:

css - 您可以使用 CSS 制作 Stack Panel 类型的布局吗?

javascript - 如何在 Chrome 的开发者工具中按主机和端口进行过滤?

javascript - 无法访问 JSON 数组中的元素

html - 当浏览器达到特定宽度时,如何使图像自行调整大小?

javascript - 我对刷卡器和箭头按钮有疑问(魔法)

javascript - 带有 "image in div"缩放胡佛效果的旋转木马松散响应行为

google-chrome - 如何在 Chrome 中启用自动播放?

api - chrome.extension.onMessage 未定义

安卓+电话间隙 : Attempt to call getDuration without a valid mediaplayer

javascript - 如何在浏览器宽度减小的情况下将表格数据放在开头?