Flexbox wraps outside of container [closed]

折月煮酒 提交于 2019-12-13 19:34:16

问题


I've created a header including a navigation with flexbox. My problem is, as soon as the screen gets resized to approx. 1200px the line wraps and my navigation buttons spill outside of thecontainer - how can I fix this?

http://codepen.io/TimRos/pen/xGVwQE

.main-nav {
    list-style: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-end;
    align-items: flex-end;
    height: 150px;
}

thanks!


回答1:


Simply remove the fixed height (height: 150px;). This will let the nav resize when the menu items wrap like this:

.main-nav {
    list-style: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-end;
    align-items: flex-end;
}


来源:https://stackoverflow.com/questions/30202294/flexbox-wraps-outside-of-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!