[英]How to render the cards side by side (horizontally) rather than vertically in react?
[英]How to make React-Day-Picker months side by side horizontally instead of vertically aligned
我正在使用 react-day-picker 组件,我已经能够显示 2 个月,但它们在屏幕上显示在另一个月之上。 如何将其更改为水平对齐?我尝试更改 CSS 并使用内联,但它不起作用。
import React from 'react';
import DayPicker from 'react-day-picker';
import 'react-day-picker/lib/style.css';
export default function Example() {
return <DayPicker numberOfMonths={2} />;
}
您可以尝试将其添加到您的 styles:
.DayPicker-Months {
flex-direction: row;
flex-wrap: nowrap;
}
您可以在此处查看实际示例: https://codesandbox.io/s/react-day-picker-base-yledo
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.