4 replies [Last post]
zeeker
Offline
Regular
Last seen: 16 years 8 weeks ago
Joined: 2003-10-11
Posts: 11
Points: 0

I am writing some in php that needs some forms and everything done in CSS. I have a form with two 'SELECT' and two 'INPUT'...

The lines of code look like this :

FORM :
<div><form style="width:400px; border:2px dotted #999; margin:10px; padding:5px; " name="" method="" action="">
SELECT :
<div style=" margin:2px;"><select name="" style="width:100%" border:1px solid #000;"></div>
INPUT :
<div style=" margin:2px;"><input type="text" name="" style="width:100%" border:1px solid #000;"></div>

Now in IE and Mozilla, I am getting a 5 or so pixel shortness on my SELECTs! But it works fine in Opera :!:

Can some one please point me in the right direction...

Thank You

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 16 years 3 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

Form object widths...

I think your problem is that your 2 select and input divs are inside the form div, so you are already getting a 5px padding before you already start giving them a 2px margin

remove the padding or make it 2px and then remove the margins from select and input.

Regards
Day

The only way to learn is to do it yourself

zeeker
Offline
Regular
Last seen: 16 years 8 weeks ago
Joined: 2003-10-11
Posts: 11
Points: 0

Form object widths...

I have tried removing all styles...the same spacing problems accure!?!??!
I also tried taking off just the form styles and appling just the styles to the 'INPUT' and 'SELECT' and vise-versa...same thing...

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 16 years 3 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

Form object widths...

can you just increase their length by 5px's in hacks only for IE and Moz or decrease it in a hack for opera.

Otherwise not sure why.

Regards
Day

The only way to learn is to do it yourself

zeeker
Offline
Regular
Last seen: 16 years 8 weeks ago
Joined: 2003-10-11
Posts: 11
Points: 0

Form object widths...

I guess the thinking that I am doing over here is...I have seen it done correctly in multiple browsers...and isn't the whole idea of css is to get around not having to use hacks?

I just tried using the 'SPAN' tag instead of the 'DIV' tag...got the same results but accually ~10px longer than the 'DIV'!!!