Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
モバイルデバイスで使用するために、通常の入力タイプの日付を使用しようとしています。ただし、CSS で設定された幅は、Safari (または Webkit) によって無効にされます。
CSSに追加-webkit-appearance: none;することで、幅が期待どおりに機能します。しかし、それがピッカーであることを示す矢印など、必要な他のすべてのスタイリングを失います。
-webkit-appearance: none;
入力タイプの日付の基本的なスタイルを維持しながら、幅を自分で制御する方法はありますか?
を追加し-webkit-min-logical-width: <your desired value>ます。それは私のために問題を解決しました!
-webkit-min-logical-width: <your desired value>
選択のみを行いたい場合は、 この CSS 行を試してくださいinput[type='date']。input[type='time']
input[type='date']
input[type='time']
input[type='date'], input[type='time'] { -webkit-appearance: none; }