终于解决文字两边固定位置,不随页面放大或缩小而改变位置

<template>
<div class="box">
  <div class="left">12</div>
  <div class="right">23</div>
</div>
</template>
<style scoped>
.left{
  /* 给左边设置一个固定宽度,可根据自己想要设置的右边的位置,改变这个左边的数值 */
  width:95%;
}
.right {
  /* 将右边的盒子flex设置为1 */
  flex:1;
}
.box{
  display: flex;
}

</style>

实现效果

 将页面放大一倍后,字体原来的位置不变

猜你喜欢

转载自blog.csdn.net/m0_65380423/article/details/129870807