1

I gave the same width for 2 elements , one is a input text field of a form , other is a div. But they both render different widths when displayed. input field appears to be more wider than the div element. Can someone explain me how to fix it? Is there some fixed proportion by which input field shows more width? Help me.

1
  • This might be because of inputs field's border as divs by default don't have border. Commented Jan 3, 2013 at 5:54

1 Answer 1

2

use :

input
{
    box-sizing:border-box;
    -moz-box-sizing:border-box;
    -webkit-box-sizing:border-box;
}

Working Fiddle

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

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.