4

Actually, I want to implement a text box as shown in the figure:enter image description here

I want that the user should be able to enter the number in the required space. Note that it would be transparent so that the background is visible. A solution involving html5 canvas would also be good.

So, is it possible to do this? If so, how?

3
  • 1
    Have you tried? How does your code look? Maybe try regular input fields and css styling. Commented May 10, 2012 at 5:33
  • it is a simple text box. My problem is to make the text box just a underline rather than the text box. Commented May 10, 2012 at 5:38
  • Anyways solved now, thanks to Christian. Commented May 10, 2012 at 5:38

2 Answers 2

12

What have you tried so far? You pretty much answered your own question, make the input have a transparent background.

input {
    border: 0;
    outline: 0;
    background: transparent;
    border-bottom: 2px solid black;
    width: 20px;
}

jsFiddle

Sign up to request clarification or add additional context in comments.

1 Comment

oh silly me, how did I miss this one! Thanks. Actually I knew about transparent, but didn't knew that border:0 & outline:0 work for an input field too. I couldn't remove the outer box in the <input> tag
0

Set <input> border be only bottom side. Here is the demo, just like your picture shows.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.