0

I've created an image of the result I want for a couple of input fields.

What I've tried to get that result is this:

input {
  padding-left: 2px;
  padding-top: 2px;
  height: 1.8em;
  font-size: 1em;
}

The problem I'm having in creating this is any time I resize the text so it is relatively smaller than the input field, the height of the input field changes accordingly as well, it doesn't appear to be paying any attention to the height attribute, only font-size.

I want the text to end up at about 60% the height of the input field, and as above, quite close in to the bottom left corner.

Can someone point me in the right direction for this?

1
  • Add padding-top:5px; or similar until you get what you need. Commented Oct 6, 2012 at 2:50

1 Answer 1

2

em is based off the size of the font (the point size), so if you change the font-size, the height (as you have specified it) will change. Use pixel height if you want it independent of font-size.

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.