外容器.cart-decrease的line-height值造成的抖动问题。
来源:17-17 cartcontrol组件(3)

7P_LonG
2017-06-08
.cart-decrease, .cart-add { display: inline-block; padding: 6px; font-size: 24px; line-height: 24px; color: rgb(0, 160, 220); } ... .cart-decrease { opacity: 1; transform: translate3d(0, 0, 0); line-height:0; .inner { display: inline-block; line-height: 24px; font-size: 24px; color: rgb(0, 160, 220); ... } }
本人在依教程改写时,为了省事仅将动画部分移出,使得外容器cart-decrease 与liner分别设定了
line-height,font-size。当增加由0-1时,出现了抖动,排除是动画因素后,是因为fz lh的原因。重新将cart-decrease的line-height改为0,问题解决。
张鑫旭 vertical-align-and-line-height 查阅资料后,认为是cart-decrease 的基线不为0,而是inner内部元素的baseline ,因此和cart-add不同(0),所造成的偏移。
但实际上还是有些模糊。。。。希望有人解惑。
写回答
1回答
-
ustbhuangyi
2017-06-08
教程的写法有问题吗?
012017-06-08
相似问题