摸索出来的文字居中 定位后怎么都不居中,,

<!--pages/fenxiang/fenxiang.wxml-->
<page>
<view class='top'>
<image class='image_a' src='http://img.xiangshu.com/Day_180404/60_650941_3a185077b85c40e.jpg' mode="aspectFill"></image>
<view class='gonggao'>
<image class='image_b' src='https://ccian.com/fenxiang1.png' mode="aspectFill"></image>
<text>公告:陈一发儿刚刚领取了5元红包</text>
</view>
</view>
<view class='bottom'></view>
</page>
/* pages/fenxiang/fenxiang.wxss */

page {
margin: 0;
padding: 0;
width: 750rpx;
overflow-x: hidden;
}

page .top {
width: 750rpx;
height: 300rpx;
position: relative;
}

page .top .image_a {
width: 750rpx;
height: 300rpx;
}

page .top .gonggao {
position: absolute;
top: 250rpx;
left: 0;
width: 750rpx;
height: 50rpx;
background: rgba(255, 255, 255, 0.2);
display: flex;
flex-direction: row;
align-items: center;
}

page .top .gonggao .image_b {
width: 33rpx;
height: 32rpx;
padding-left: 40rpx;
padding-right: 20rpx;
display: block;
}

page .top .gonggao text {
line-height: 50rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
color: rgba(255, 255, 255, 1);
display: block;
}
posted @ 2018-09-14 11:25  小小小小小前端  阅读(163)  评论(0编辑  收藏  举报