You are here: DEVPPL Forum Programming CSS Forum
NOTIFICATIONS
54.318
MEMBERS
15.720
TOPICS
62.399
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

input styling

0

Loading

input styling

Postby Nicholasstephan » Wed Sep 22, 2010 12:21 am

Hey,

Call me obsessive, but a single pixel does matter. And this is driving me insane.

If I have a normal text input, and I give it the following css styles:

font-size:12px;
line-height:12px;
padding:4px;
border:1px solid #000;

it should be 12 (line height) + 8 (padding top and bottom) + 2 (border top and bottom) = 22 pixels tall (this is visible area, I'm not worried about margins). But it's not!! It comes out at 25 pixels tall.

If this only happened in IE I would dismiss it as IE acting like IE, but it's doing this in all major browsers, so I must be missing something.

Anyone know where those extra 3 pixels are coming from?

Thanks.
Nicholasstephan
 
Reputation: 0
Posts: 1
Joined: Wed Sep 22, 2010 12:10 am
Highscores: 0
Arcade winning challenges: 0

input styling - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: input styling

Postby HotNoob » Wed Sep 22, 2010 5:42 pm

try setting the margin to 0px 0px 0px 0px;

i find the default margin values change from browser to browser.
---
also since it is an input it might be a bit off..
anyway, easy solution change ur line height to 9px lol :P
HotNoob
 
Reputation: 0
Posts: 169
Joined: Sun May 02, 2010 2:38 am
Highscores: 0
Arcade winning challenges: 0
^ Back to Top