I tried using padding:10px to this example but it makes the div move to the left. Any solutions you might think?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s because the width does not include any padding or margin you might have on the element. You’ll need to subtract the 40px from your total width size to keep it the same size.
Try this:
http://jsfiddle.net/animuson/NncNE/3/
Edit: If you want, you can use
padding: 15px 20px, I think it looks better and it’s better centered.