![](/img/trans.png)
[英]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.