Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

html display textbox as a blankline css bootstrap

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

class="form-control form-control-sm"

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading