老师,css布局求问
来源:21-4 实现movie-grid template
Dulk
2018-02-08
如图,我想让如图红色部分的图片居右上角,不会调,在.weibo-more中设置float:right也没有用。(我是后端,前端不太熟,鼓捣了很久没弄出来)
下面是我的wxml和wxss:
<view class="weibo-container"> <view class="weibo-head-container"> <image class="weibo-avatar" src="/images/demo/avatar/3.png"></image> <view class="weibo-part"> <text class="weibo-nickname">Dulk</text> <view class="weibo-via-container"> <text class="weibo-via-time">2分钟之前</text> <text class="weibo-via-from">来自View微博小程序</text> </view> </view> <image class="weibo-more" src="/images/demo/icon/more.png"></image> </view> <view class="weibo-body-container"> <text>大福大</text> <image src=""></image> </view> </view>
.weibo-container { border: 1px solid #405f80; width: 95%; margin: 10rpx auto; border-radius: 5px; } .weibo-head-container { border: 1px solid #405f80; display: flex; flex-direction: row; } .weibo-avatar { border: 1px solid #405f80; width: 120rpx; height: 120rpx; } .weibo-part { border: 1px solid #405f80; display: flex; flex-direction: column; justify-content: center; } .weibo-nickname { border: 1px solid #405f80; font-size: 30rpx; font-weight: 700; margin: 5rpx; } .weibo-via-container { border: 1px solid #405f80; display: flex; flex-direction: row; margin: 5rpx; } .weibo-via-time { border: 1px solid #405f80; font-size: 24rpx; } .weibo-via-from { border: 1px solid #405f80; font-size: 24rpx; margin-left: 10rpx; } .weibo-more { border: 1px solid #405f80; width: 10rpx; height: 40rpx; }
写回答
1回答
-
7七月
2018-02-08
CSS方面的,不太可能看着代码给你调出来,希望理解。可以尝试使用Flex布局。float的限制比较多。
012018-02-09
相似问题