请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

post-detail样式

https://img1.sycdn.imooc.com/szimg//58784c470001f21f04710835.jpg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<view class="container">
    <image src="/images/post/sls.jpg" class="head-image"></image>
    <view class="author-date">
        <image src="/images/avatar/3.png" class="avatar"></image>
        <text class="author">作者</text>
        <text class="const-text">发布与</text>
        <text class="date">三天前</text>
    </view>
    <text class="title">我是title</text>
    <view class="tool">
        <view class="circle-img">  
            <image  src="/images/icon/collection.png"></image>
            <image class="share-img" src="/images/icon/share.png"></image>
        </view>
        <view class="horizon"></view>
    </view>     
    <text class="detail">
        我是内容
    </text>
</view>
---------post-detail.wxss
.container {
  display: flex;
  flex-direction: column;
}
 
.head-image {
  width100%;
  height460rpx;
}
 
 
.author-date {
  flex-direction: row;
  margin-left30rpx;
  margin-top20rpx;
}
 
.avatar {
  height64rpx;
  width64rpx;
  vertical-alignmiddle;
}
 
.author {
  font-size30rpx;
  font-weight300;
  margin-left20rpx;
  vertical-alignmiddle;
  color#666;
}
 
.const-text {
  font-size24rpx;
  color#999;
  margin-left20rpx;
}
 
.date {
  font-size24rpx;
  margin-left30rpx;
  vertical-alignmiddle;
  color#999;
}
 
.title {
  margin-left40rpx;
  font-size36rpx;
  font-weight700;
  margin-top30rpx;
  letter-spacing2px;
  color#4b556c;
}
 
.tool {
  margin-top20rpx;
}
 
.circle-img {
  floatright;
  margin-right40rpx;
  vertical-alignmiddle;
}
 
.circle-img Image {
  width90rpx;
  height90rpx;
}
 
.share-img {
  margin-left30rpx;
}
 
.horizon {
  width660rpx;
  height1px;
  background-color#e5e5e5;
  vertical-alignmiddle;
  positionrelative;
  top46rpx;
  margin0 auto;
  z-index-99;
}
 
.detail {
  color#666;
  margin-left30rpx;
  margin-top20rpx;
  margin-right30rpx;
  line-height44rpx;
  letter-spacing2px;
}

老师不好意思,打扰您,这个问题我不太懂哪里出了问题,好像上面的空白被固定下来了一样,,怎么改都在,而且作者那一行一直都是居中

正在回答

插入代码

1回答

我是顽主 2017-01-13 12:52:34

用你的代码测试,没有出现上方空白的情况,一切正常,请看下面示意图。

问题可能的原因:

post-detail.wxss

.container {

  display: flex;

  flex-direction: column;

}

当前的.container 和其他页面class名字重复了(比如欢迎页)

建议把详细页面的.container 改为.container-post-detail 更加语义化,也可以区分其他详细页面。

https://img1.sycdn.imooc.com/szimg//58785c520001755903980682.jpg


0 回复 有任何疑惑可以回复我~
  • 提问者 纪年3252859 #1
    原来是这样啊,感谢~~~~试了一下确实可以啦。感谢感谢
    回复 有任何疑惑可以回复我~ 2017-01-13 13:40:01
  • 提问者 纪年3252859 #2
    非常感谢!
    回复 有任何疑惑可以回复我~ 2017-01-13 16:08:17
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号