0

I use the following HTML:

<textarea></textarea> 

And the following CSS:

textarea{ display: block; margin: 0px; padding: 0px; border: 0px; outline: 0px; width: 100px; height: 100px; resize: none; } 

Firefox, Safari give me just what I expected a textarea of 100 x 100, but Chrome 111 x 111 (even the Chrome inspector displays 100x100).

Here is an screenshot I took: http://afbeelding.im/GF5f3d

1
  • Are you sure there's nothing else affecting your box? Commented May 10, 2012 at 1:48

1 Answer 1

3

Confused over padding and margin stuff? box-sizing is here!

box-sizing can make sure the element's size is the exact same size of what you set, no matter what padding or margin, it is still the same.

box-sizing: border-box; //This will make your life much easier. 

For more: http://www.css3.info/preview/box-sizing/

Demo: http://jsfiddle.net/DerekL/ZmXKC/

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.