.chart-card { display: flex; flex-direction: column; align-items: center; justify-content: space-around; /* 或者使用 space-between 根据您的喜好 */ text-align: center; } .chart-text { margin: 0; font-size: 24px; color: rgb(126 221 243 / 100%); } .chart-button { width: 17rem; height: 5; margin: 5px; font-size: 28px; line-height: 22px; color: rgb(255 0 0 / 100%); text-align: center; background-color: rgb(6 70 120 / 0%); background-image: url('/assets/dashboardButtonBg.png'); background-repeat: no-repeat; background-position: center; background-size: contain; /* 或者可以使用 'contain' 根据你的需要 */ border-width: 0; } @media (min-width:0){ .chart-button {font-size:12px;} } @media (min-width: 360px){ .chart-button {font-size:14px;} } @media (min-width: 920px){ .chart-button {font-size:18px;} } @media (min-width: 1920px){ .chart-button {font-size:26px;} } .chart-container { width: 10rem; height: 10rem; }