简体   繁体   中英

How can I customize input date with css

I am trying customize my input date pick like this design here:

在此处输入图像描述

here is my following code and default design:

  <input
    type="date"
    name="date"
    defaultValue={currentDate || dateInput}
    onChange={(e) => setDateInput(e.target.value)}
    required
  />

在此处输入图像描述

How can I edit it with css or scss?

You need to add class:

<input
    className="datePicker"
    type="date"
    name="date"
    defaultValue={currentDate || dateInput}
    onChange={(e) => setDateInput(e.target.value)}
    required
  />

And in css:

.datePicker {
  background-color: red;

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM