猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.6 KiB

3 months ago
  1. //水平垂直居中
  2. .flex-rowc {
  3. display: flex;
  4. flex-direction: row;
  5. justify-content: center;
  6. align-items: center;
  7. }
  8. //主轴为水平方向,起点在左端,垂直居中
  9. .flex-rowl {
  10. display: flex;
  11. flex-direction: row;
  12. justify-content: flex-start;
  13. align-items: center;
  14. }
  15. //主轴为水平方向,起点在右端,垂直居中
  16. .flex-rowr {
  17. display: flex;
  18. flex-direction: row;
  19. justify-content: flex-end;
  20. align-items: center;
  21. }
  22. //主轴为垂直方向,垂直居中
  23. .flex-colc {
  24. display: flex;
  25. flex-direction: column;
  26. justify-content: center;
  27. align-items: center;
  28. }
  29. //主轴为垂直方向,起点在上沿,水平居中
  30. .flex-colt {
  31. display: flex;
  32. flex-direction: column;
  33. justify-content: center;
  34. align-items: flex-start;
  35. }
  36. //主轴为垂直方向,起点在下沿,水平居中
  37. .flex-colb {
  38. display: flex;
  39. flex-direction: column;
  40. justify-content: center;
  41. align-items: flex-end;
  42. }
  43. .flex-colend-between {
  44. display: flex;
  45. flex-direction: column;
  46. justify-content: space-between;
  47. align-items: flex-end;
  48. }
  49. //主轴为垂直方向,起点在下沿,水平居中
  50. .flex-col-between {
  51. display: flex;
  52. flex-direction: column;
  53. justify-content: space-between;
  54. }
  55. //两端对齐,项目之间的间隔都相等
  56. .flex-between {
  57. display: flex;
  58. justify-content: space-between;
  59. align-items: center;
  60. flex-direction: row;
  61. }
  62. // 只保证两端对齐
  63. .flex-b {
  64. display: flex;
  65. justify-content: space-between;
  66. }
  67. //每个项目两侧的间隔相等
  68. .flex-around {
  69. display: flex;
  70. justify-content: space-around;
  71. align-items: center;
  72. flex-direction: row;
  73. }
  74. .flex-1 {
  75. flex: 1;
  76. }