我有一个嵌套的flexbox布局(使用bootstrap v4),它根据横向/纵向模式改变方向.第一级div(由flexbox使用order属性放置)#no,包含5个用作按钮的图标.该order属性不能像我期望的那样在这些图标上工作.
如果我不使用order属性,图标按自然顺序排列; 但是,如果我尝试使用该order属性进行布局,则不起作用.在代码中,info-div(order:3)应该是最后一个元素.事实并非如此.我可以通过改变源中的顺序来获得我想要的订单; 但是,我想澄清一下我的误解.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portrait of New York</title>
<style>
html, body {
width:100%;
height:100%;
}
#container {
height: 100%; width:100%;
display: flex; display: -webkit-flex;
flex-wrap: nowrap; -webkit-flex-wrap: nowrap;
justify-content: center; -webkit-justify-content: center;
align-items: center; -webkit-align-items: center;
align-content: space-between; -webkit-align-content: space-between;
} …Run Code Online (Sandbox Code Playgroud)