cover-view 布局用flex ,flex-direction: column 不生效!
wxml
wxss
.w1{
width: 750rpx;
height: 300px;
background-color: wheat;
display: flex;
display: -webkit-flex;
flex-direction: column;
}
.w2{
width: 750rpx;
height: 50px;
background-color: yellow;
border-bottom: 2px red solid;
}
效果:
微信小程序开发者回答:
S***:
这个是开发者工具上的截图?
S***:
直接复制代码后在开发者工具上的效果,是否是期望的结果?
S***:
目测有其它的 css 影响了你这边的 demo
马***:
好的,谢谢!
马***:系统记录
暴***:
还是有问题,在真机上flex是OK的,但是在开发工具上有问题
马***:
没问题吧?你上代码看看!!
暴***:
你那里没问题吗?
看我的这个帖子
https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=44648cb3ee0e3d8eb955de296c384c86&token=15940334&lang=zh_CN
马***:
能直接上代码么?
暴***:
wxml
wxss
/**
* 纵向从上往下排列(顶对齐)
*
*/
.flex-column {
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
width: 100%;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column; }
/**
* 向从左到右排列(左对齐)
*
*/
.flex-row {
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
width: 100%;
-webkit-box-direction: normal;
-webkit-box-orient: horizontal;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row; }
.flex-row-space-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
justify-content: space-between; }
map {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 1; }
cover-view {
overflow: visible;
line-height: normal;
white-space: inherit;
pointer-events: auto; }
.container {
position: relative;
width: 100%;
height: auto;
display: flex;
justify-content: space-between; }
.container .float-button {
z-index: 1000;
background: #FFFFFF;
box-shadow: 0 4px 12px 0 rgba(31, 51, 153, 0.2);
width: 72rpx;
height: 72rpx;
line-height: 72rpx;
text-align: center;
本文网址:http://www.91bianli.com/weixinxiaochengxu/28381.html