ZBLOG

.serice_common_alert_box { position: fixed; z-index: 99; top: 0; left: 0; bottom: 0; right: 0; display: flex; flex-direction: row; justify-content: center; align-items: center; .serice_common_alert_layer { position: absol...

你可以通过将所有的 px 单位除以 2 来简化 CSS 样式表。以下是修改后的代码:

  1. .serice_common_alert_box {
  2. position: fixed;
  3. z-index: 99;
  4. top: 0;
  5. left: 0;
  6. bottom: 0;
  7. right: 0;
  8. display: flex;
  9. flex-direction: row;
  10. justify-content: center;
  11. align-items: center;
  12. .serice_common_alert_layer {
  13. position: absolute;
  14. top: 0;
  15. left: 0;
  16. bottom: 0;
  17. right: 0;
  18. background-color: rgba($color: #000000, $alpha: 0.7);
  19. }
  20. .serice_common_alert_content_box {
  21. padding: 16px; // 从32px变为16px
  22. background-color: #fff;
  23. border-radius: 8px; // 从16px变为8px
  24. overflow: hidden;
  25. z-index: 2;
  26. flex: 1;
  27. margin: 0 38px; // 从76px变为38px
  28. color: #222;
  29. .serice_common_alert_title {
  30. margin: 8px 0; // 从16px变为8px
  31. font-size: 16px; // 从32px变为16px
  32. font-weight: 500;
  33. text-align: center;
  34. }
  35. .serice_common_alert_content {
  36. margin-bottom:24px; // 从48px变为24px
  37. font-size:14px; // 从28px变为14px
  38. text-align: center;
  39. }
  40. .serice_common_alert_btn_box {
  41. display:flex ;
  42. flex-direction : row ;
  43. align-items:center ;
  44. justify-content:center ;
  45. .serice_common_alert_btn {
  46. &:nth-child(1) {
  47. margin-right :6 px ; // 从12 px变为6 px
  48. }
  49. &:nth-child(2) {
  50. background-color:#573d91 ;
  51. color:#fff ;
  52. border-color:#573d91 ;
  53. }
  54. flex :1 ;
  55. border :0.5 px solid #c8c8c8 ;
  56. transform :rotateZ (360deg ) ;
  57. height :36 px ; // 从72 px变为36 px
  58. background-color:#fff ;
  59. font-weight :500 ;
  60. display:flex ;
  61. flex-direction :row ;
  62. align-items:center ;
  63. justify-content:center ;
  64. border-radius :50 px ; // 从100 px变为50 px
  65. font-size :14 px ; // 从28 px变为14 px
  66. &.hidden_btn{
  67. display:none ;
  68. }
  69. }
  70. }
  71. }

这些调整保留了原始的样式布局,同时将所有带 px 的值都减半。注意,在进行这样的调整时,确保查看效果,以便确认视觉上的一致性是否符合你的预期。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=20487

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?