问题:在移动端中使用line-height=height实现文字垂直居中时,在安卓手机会发现文字偏上!

解决:

1、利用flex布局中的垂直居中属性实现垂直居中,父元素设置

display:flex;
height:1rem;
align-items: center;

 子元素

 transform: scale(0.5);
  transform-origin: left center;

2、不直接设置line-height=height,而是设置 

line-height:normal; 
padding:10px 0;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案