HighDots Forums  

vertical align middle input field in a form

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


Discuss vertical align middle input field in a form in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default vertical align middle input field in a form - 08-04-2009 , 02:57 PM






Ok I know this topic has been drowned out and I have read many
articles on this including my CSS cookbook third edition by Oreily. Im
stumped. Here is my div, all I want to do is vertically align it to
the middle of the div.

<div id="top_bluenav_bottom"><form id="signin" action=""
method="post"><input name="email" type="text" /> <input
name="password" type="password" /> <input name="submit" type="submit"
value="Sign In" /></form></div>

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

Default Re: vertical align middle input field in a form - 08-04-2009 , 03:59 PM






On 2009-08-04, cbielich (AT) gvchristian (DOT) com <cbielich (AT) gvchristian (DOT) com> wrote:
Quote:
Ok I know this topic has been drowned out and I have read many
articles on this including my CSS cookbook third edition by Oreily. Im
stumped. Here is my div, all I want to do is vertically align it to
the middle of the div.
You mean you want the form in the middle of the div?

Quote:
div id="top_bluenav_bottom"><form id="signin" action=""
method="post"><input name="email" type="text" /> <input
name="password" type="password" /> <input name="submit" type="submit"
value="Sign In" /></form></div
Set the div to display: table-cell and vertical-align: middle. Probably
won't work in IE.

Are you setting a height on the div? If so, there are a few other
options.

Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: vertical align middle input field in a form - 08-04-2009 , 05:34 PM



On Aug 4, 12:59*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
Quote:
On 2009-08-04, cbiel... (AT) gvchristian (DOT) com <cbiel... (AT) gvchristian (DOT) com> wrote:

Ok I know this topic has been drowned out and I have read many
articles on this including my CSS cookbook third edition by Oreily. Im
stumped. Here is my div, all I want to do is vertically align it to
the middle of the div.

You mean you want the form in the middle of the div?

div id="top_bluenav_bottom"><form id="signin" action=""
method="post"><input name="email" type="text" /> <input
name="password" type="password" /> <input name="submit" type="submit"
value="Sign In" /></form></div

Set the div to display: table-cell and vertical-align: middle. Probably
won't work in IE.

Are you setting a height on the div? If so, there are a few other
options.
yes the height is set here is the css for the div.

#top_bluenav_bottom {
text-align:left;
width:950px;
height:41px;
background-image:url(pics/top_bluenav_bottom.gif);
background-repeat:no-repeat;
}

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

Default Re: vertical align middle input field in a form - 08-05-2009 , 12:27 PM



On 2009-08-04, cbielich (AT) gvchristian (DOT) com <cbielich (AT) gvchristian (DOT) com> wrote:
Quote:
On Aug 4, 12:59*pm, Ben C <spams... (AT) spam (DOT) eggs> wrote:
On 2009-08-04, cbiel... (AT) gvchristian (DOT) com <cbiel... (AT) gvchristian (DOT) com> wrote:

Ok I know this topic has been drowned out and I have read many
articles on this including my CSS cookbook third edition by Oreily. Im
stumped. Here is my div, all I want to do is vertically align it to
the middle of the div.

You mean you want the form in the middle of the div?

div id="top_bluenav_bottom"><form id="signin" action=""
method="post"><input name="email" type="text" /> <input
name="password" type="password" /> <input name="submit" type="submit"
value="Sign In" /></form></div

Set the div to display: table-cell and vertical-align: middle. Probably
won't work in IE.

Are you setting a height on the div? If so, there are a few other
options.

yes the height is set here is the css for the div.

#top_bluenav_bottom {
text-align:left;
width:950px;
height:41px;
background-image:url(pics/top_bluenav_bottom.gif);
background-repeat:no-repeat;
}
Well, you could try line-height: 41px on the div, display: inline on
the form, and vertical-align: middle on the input.

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.