@Samrtiboy你这个解释没错,我假设这位同学问的问题是怎么计算 header-input 的高度
header 的line-height是 .86rem,header-input 的line-heigh 是 .62rem,margin-top: .12rem, 那这样自然地可算出来margin-bottom: .12rem, 也就是说 .62rem + .12rem + .12rem = 0.86rem
代码应该这么写:
<style lang="stylus" scoped>
.header
display: flex
background: #00bcd4
line-height: .86rem
color: #ffffff
.header-left
width: .64rem
.header-input
flex: 1
background: #fff
height: .62rem
line-height: .62rem
margin-top: .12rem
margin-left: .2rem
border-radius: .1rem
color: #ccc
.header-right
width: 1.24rem
text-align: center
</style>
如果老师写的那样 header-input 的 line-height: .64rem 的话 输入框的上下(margin)距离不一致, 如果我错了, 请你们原谅。