HighDots Forums  

How to get text input box to fill remaining space?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How to get text input box to fill remaining space? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: How to get text input box to fill remaining space? - 06-30-2008 , 02:31 PM






Scripsit Ben C:

Quote:
On 2008-06-29, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote:
[...]
.foo
{
display: block;
overflow: hidden; /* to make it a BFC */
}
input[type="text"] { width: 100%; }
input[type="button"] { float: right; }
[...]
b) on IE 7, it causes the right border of the input box hit the
button; this looks odd and puzzling

I suppose a small margin on the input box might solve that problem.
Well, how much margin can you have if you have 100% width? On IE 7,
setting a margin does not seem to have any effect.

(If you set left margin for the button, the right border of the text
input box magically disappears.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #12  
Old   
Ben C
 
Posts: n/a

Default Re: How to get text input box to fill remaining space? - 07-01-2008 , 03:18 AM






On 2008-06-30, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote:
Quote:
Scripsit Ben C:

On 2008-06-29, Jukka K. Korpela <jkorpela (AT) cs (DOT) tut.fi> wrote:
[...]
.foo
{
display: block;
overflow: hidden; /* to make it a BFC */
}
input[type="text"] { width: 100%; }
input[type="button"] { float: right; }
[...]
b) on IE 7, it causes the right border of the input box hit the
button; this looks odd and puzzling

I suppose a small margin on the input box might solve that problem.

Well, how much margin can you have if you have 100% width?
Difficult unless you make the margin a percentage and use 5% + 95% or
something. In that case you might as well just set width to 95% and not
bother with margin.

Quote:
On IE 7, setting a margin does not seem to have any effect.
Well I can't cure a rainy day.

Actually a more sensible solution in the example I gave would be some
right padding on .foo instead. Then you can set the padding in pixels.

Quote:
(If you set left margin for the button, the right border of the text
input box magically disappears.)
Presumably it hasn't disappeared but is just covered up by the left edge
of the button.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.