Javascript 传单和Flexbox设计问题
我正在尝试实现flexbox设计,在浏览器窗口的左侧有一个侧栏,在右侧有一个传单地图 我有两个问题:Javascript 传单和Flexbox设计问题,javascript,css,leaflet,flexbox,Javascript,Css,Leaflet,Flexbox,我正在尝试实现flexbox设计,在浏览器窗口的左侧有一个侧栏,在右侧有一个传单地图 我有两个问题: 如果我尝试使用CSS中的位置选择器更改地图的位置,它会使地图显示在页面的左上角,并覆盖所有内容 我通常无法让地图覆盖侧边栏右侧的整个开放区域,这正是我想要的 这是我的HTML: <div class="flexbox"> <header class="flexbox-header"> <div class="Header Header--co
<div class="flexbox">
<header class="flexbox-header">
<div class="Header Header--cozy" role="banner">
MyHeader
</div>
</header>
<main class="flexbox-body">
<article class="flexbox-content">
<div id="map"></div>
</article>
<nav class="flexbox-control-bar u-textCenter">
<strong>Navigation</strong>
</nav>
</main>
</div>
我这里有一个关于JS Fiddle的例子:
谢谢大家!
.flexbox {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: 100%;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.flexbox-header,
.flexbox-footer {
-webkit-box-flex: 0;
-webkit-flex: none;
-ms-flex: none;
flex: none;
}
.flexbox-body {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 1;
-webkit-flex: 1 0 auto;
-ms-flex: 1 0 auto;
flex: 1 0 auto;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.flexbox-content {
margin-top: 1.5em;
}
.flexbox-control-bar {
-webkit-box-ordinal-group: 0;
-webkit-order: -1;
-ms-flex-order: -1;
order: -1;
}
@media(min-width:768px) {
.flexbox-body {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
.flexbox-content {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
padding: 0 2em;
margin: 0;
}
.flexbox-control-bar,
.flexbox-ads {
-webkit-box-flex: 0;
-webkit-flex: 0 0 20em;
-ms-flex: 0 0 20em;
flex: 0 0 20em;
}
}