What is the color of the icon in an HTML5 input date picker?

Is there a way to customize the color of the calendar icon in the HTML5 date input (

<input type="date" />
) field? Specifically, I'm looking to change the icon color to #018bee or RGB: (1, 139, 238). I've read about using filters for this purpose, but my attempts so far have been unsuccessful.

https://i.sstatic.net/rL3gn.png

If you'd like to see an example, check out this Codepen: https://codepen.io/gerisd/pen/VwPzqMy

Here's the HTML code snippet:

 <input type="date" id="deadline" name="deadline" value="2021-01-01" required>

And here's the CSS styling involved:

#deadline{
  width: 100%;
  min-width: 100px;
  border: none;
  height: 100%;
  background: none;
  outline: none;
  padding-inline: 5px;
  resize: none;
  border-right: 2px solid #dde2f1;
  cursor: pointer;
  color: #9fa3b1;
  text-align: center;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  margin-right: 2px;
  filter: invert(0.8) sepia(100%) saturate(10000%) hue-rotate(240deg);
}

Answer №1

Did you attempt to test out using webkit? I stumbled upon a similar inquiry on this link

You could give this code from the mentioned question a shot:

::-webkit-calendar-picker-indicator {
filter: invert(1);

}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Pedestrian crossing Cordova experiences delayed response despite ontouchstart attempts to fix it

I have been experiencing a delay issue when using a CSS button with the ":active" pseudo-class on my phone. Every time I click the buttons, there is a noticeable delay before entering the active phase. Here is my CSS code: .btn {...} .btn:active{...} To ...

Include a sharing option within the magiczoomplus feature

My current project involves creating a WordPress site using Artisteer along with several plugins to showcase photo galleries. To enhance the user experience, I purchased an e-commerce WordPress theme which features a share button that I really like. Now, I ...

Setting a div's background using JavaScript works flawlessly on jsfiddle.net, but encounters issues when implemented in actual code

contains the files you need. For reference, here is the link to the code on I have attempted to remove all unnecessary elements from the actual project, but it has not made a difference. document.getElementById("image").style.backgroundImage = "url(" + d ...

Is it advisable to incorporate CSS variables in place of traditional HTML color names?

As an illustration, I frequently utilize the color white in my CSS code. :root { --color-white: #fff; } I am curious if it is beneficial to define colors such as 'black' and 'white' as variables or if I should stick to using the def ...

When the content div is clicked within the overlay div, the popup will also close

I want to design a pop-up that features a container with a black background and some opacity, where the content of the popup is placed inside. Here's what I have in mind: <button (click)="showPopup = !showPopup">Open popup</button& ...

Layer one image on top of another using z-index

I'm having trouble layering one image on top of another in my code. Here is my code: body { background: #000000 50% 50%; height: 100% width:100%; overflow-x: hidden; overflow-y: hidden; } .neer { z-index: 100; position: absolute; } ...

Past methods: Obsolescence alert and caution

Trying to grasp the concepts of PHP & MYSQL, I have written this code which seems to be functioning properly. However, there are several "warnings" that I am unsure about. Nonetheless, PHP successfully connects to the database. Below are the relevant codes ...

I find myself pondering the reason behind my inability to overwrite the jquery function onRegionOver. The contents of the WAMP index.html file can

I'm curious about why I'm having trouble overriding the jquery function onRegionOver. Below is the code snippet from my WAMP index.html file. Can anyone suggest how I might use the WAMP console to troubleshoot this issue? I'm attempting to g ...

Using JavaScript to create CSS animations triggered on hover

Looking for a CSS Animation that will play forward once when the mouse enters a specific div, and then play in reverse when the mouse leaves. Check out my JsFiddle here. The div with the class ".item" should trigger the mouse enter event. The animation co ...

I'm having trouble figuring out how to add a link to a page using TypeScript. I attempted one approach, but it doesn't seem to be working

`<CommandItem><a href="@/src/app/page.tsx">My stats</a></CommandItem>` I attempted this code but it did not function as expected. I sought assistance from various methods on stackoverflow, however none of them were succes ...

Customizing the color of the thumbs on a Material UI range slider

Hey there, currently working on creating a range slider with 2 values using the material UI slider component. My goal is to customize the two thumbs with different colors. https://i.sstatic.net/BUq12.png Any ideas on how I can achieve this? ...

efforts to activate a "click" with the enter key are unsuccessful

I'm attempting to enhance user experience on my site by triggering the onclick event of a button when the enter key is pressed. I've tried various methods below, but all seem to have the same issue. Here is my HTML (using Pug): input#userIntere ...

The function setCustomValidity() will continue to display even after the form has been successfully filled out

My form is very simple and I am trying to validate it using the required attribute: <form name="form"> <label for="Header">Title</label> <input type="text" class="span5" name="Header" ng-model="Message.header" placeholder="Title" on ...

Dealing with a divided image in a separate thread: What you need to know

I am facing a challenge with incorporating a LARGE image into a website, which is affecting performance. My solution is to divide the image into smaller pieces and stitch them together using a grid upon loading. The only issue is that it must be in the ba ...

Shifting a division using insertAfter

Hey there! I'm having a bit of trouble using the insertAfter function. In each product in my store, I need to position an "add to cart" button after the price. This is the code I tried: <Script type="text/javascript" > jQuery(document).read ...

How do I prevent the default submission behavior in an asp:ImageButton when the user presses the enter key in ASP.NET using C#?

Whenever I attempt to use this code snippet, it doesn't seem to work properly. How can I prevent the submit behavior of an asp:ImageButton? Here is the HTML code I am working with: <td class="style101"> <asp:ImageButton ID="imgBtnPos ...

The target element is out of reach for the Puppeteer selector

When trying to extract the source of multiple images, I encountered an issue with the selectors not working properly. It seems like the elements are fake or not actually present on the page. Every page contains one of the desired elements (the main image) ...

Picture shown in the sidebar

I'm dealing with a table that has only one row containing text with new-line characters, such as: <td id='line-numbers'> <span class="number" id="1">1</span><br> <span class="number" id="2">123</span>< ...

Make sure the image is aligned in line with the unordered list

I've been having trouble trying to display an image inline with an unordered list. Here's the HTML code: <div class="customer-indiv man"> <a class="customer_thumb" href="/fan/332profile.com"> <img src="http://i.imgur.com/Wi ...

Is it possible to extract around 10 variables from a JavaScript code, then display them on a webpage after execution?

I have just completed writing a Javascript code with around 3,000 lines. This code contains over 60 variables, but there are a few specific variables that I would like to display on my main HTML page. These variables include: totalTime longitudinalAcceler ...