Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:51:04+00:00 2026-06-08T04:51:04+00:00

Is there a Webkit-specific CSS style that will allow me to control the color/size/style

  • 0

Is there a Webkit-specific CSS style that will allow me to control the color/size/style of the box around the color in an input[type=color]?

I’m setting the color and background color of the input already so it looks good with a cross-compatibility polyfill I’m using for older Chrome and Firefox.

Now that Chrome actually has a color picker, there’s a box around the color which leaves a 1px grey box floating in the middle of the input when both color and background color of the input are set to the same color.

Is there some CSS to get rid of it, either by setting that box’s width to 0, changing the style to none, or, at worst, setting the color to the same as the color and background color?


In this image, I’m talking about the grey box around the white area and outside the green:

Screenshot of color picker

I’ve found one workaround, which is to set a high enough padding that the box (the grey border and green contents) is squished to size 0. But that’s really hacky, and doesn’t look very good over in Firefox.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:51:05+00:00Added an answer on June 8, 2026 at 4:51 am

    WebKit has special CSS selectors you can use to customize form controls but they aren’t official.
    An update to WebKit in the future will probably break it.

    Please don’t use it for production!!

    But feel free to play with it for personal projects 🙂

    Method 1

    Uses webkit-specific selectors to mostly hide the non-colored part of the input.

    input[type="color"] {
    	-webkit-appearance: none;
    	border: none;
    	width: 32px;
    	height: 32px;
    }
    input[type="color"]::-webkit-color-swatch-wrapper {
    	padding: 0;
    }
    input[type="color"]::-webkit-color-swatch {
    	border: none;
    }
    <input type=color value="#ff0000">

    Method 2

    Hides the color input (opacity:0) and uses JavaScript to set the background of the wrapper to the input’s value.

    var color_picker = document.getElementById("color-picker");
    var color_picker_wrapper = document.getElementById("color-picker-wrapper");
    color_picker.onchange = function() {
    	color_picker_wrapper.style.backgroundColor = color_picker.value;    
    }
    color_picker_wrapper.style.backgroundColor = color_picker.value;
    input[type="color"] {
    	opacity: 0;
    	display: block;
    	width: 32px;
    	height: 32px;
    	border: none;
    }
    #color-picker-wrapper {
    	float: left;
    }
    <div id="color-picker-wrapper">
    	<input type="color" value="#ff0000" id="color-picker">
    </div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem only happens on input[type=text] in Webkit. No matter what I do, there
Is there a way to customize a scrollbar with only CSS that effects a
There are a few references on the internet to ::-webkit-selection , a WebKit-specific version
the title pretty much explains it. Please note that this is a WebKit-specific issue
Besides the following list, are there other CSS vendor prefixes that are used for
In essence what I'm trying to do is create a CSS style that can
Is there anyway of modifying the CSS in the Webkit's CSS inspector, and seeing
I've noticed that there is fragmentation around the animation support in HTML5. I was
I've noticed that there is fragmentation around the animation support in HTML5. I was
There is a moment in my app, that I need to force to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.