对于一个学校元素,我必须制作一个网站。我制作的网站似乎其网格布局在 Firefox 中显示不正确。在 chrome/所有浏览器中,它应该看起来像这样
但是在 Firefox 中它会像这样出现,
It's almost like there's padding on the container or a margin on the row, but there isn't.
如果有人能提供帮助那就太好了。我在这里添加了一个JSFiddle,https://jsfiddle.net/o31t9eLb/
最佳答案
您应该在 .sidebar 和 .container 上添加 vertical-align: top;
,因为默认情况下,vertical-align 设置为中间。
原因在这里得到了很好的解释:Default value of vertical-align for table cells
关于html - 网格布局在 Firefox 中被破坏,但在 Chrome 中却没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41115501/