Search code examples
htmlcssreactjslabel

Toggle switch css issue


I was using a toggle switch in my code it was working well.

I change some stuff in my project and now, two arrrows and a white vertical line appears on my switch and I don't understand why and where it comes from :(

There, a picture :

my toggle switch

1

My code :

function Dashboard() {
    return (
      <>
         <label className="switch">
            <input type="checkbox"/>
            <span className="slider round"></span>
          </label>
      </>
    );
}

I used this page for css : https://www.w3schools.com/howto/howto_css_switch.asp


Solution

  • You can use this pseudo class Reference!

    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    
    /* Firefox */
    input[type=number] {
      -moz-appearance: textfield;
    }