Home > Blockchain >  html display textbox as a blankline css bootstrap
html display textbox as a blankline css bootstrap

Time:06-07

I am new to using front-end designs. I have tried to convert a input textbox of type number as a blankline. Added below css style

input[type=number] {
background: transparent;
border: none;
border-bottom: 1px solid #000000;
outline: none;
}

And using bootstrap form-control css for more responsiveness


But my screen shows the line with navigation bar end of the line as below. Also I need to limit max of 4 numbers only on this number box ? How to set fixed size and remove the unnecessary bar on the right side?

enter image description here

CodePudding user response:

The bar is called a "spinner", you remove it like this:

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

You can limit the number of characters with the maxlength="4" attribute on the input (you can't do that with CSS).

Additionally, if you don't want those little curves at either side, make sure you add border-radius: 0; to your input.

  • Related