Cronthenoob Posted September 18, 2006 Share Posted September 18, 2006 I went through the CSS tutorial and tried using the vertical-align attribute. And it isnt vertically aligning my divs contents. Heres the code. The problem is with the loginarea div. <html> <head> <style type="text/css"> body { margin-top:25px; margin-bottom:25px; margin-left:5px; margin-right:5px; background-color:black; } .mainwrapper { width:100%; margin:0px; padding:0px; text-align:left; } .header { width:100%; border:1px solid grey; height:100px; } .loginarea { color:white; width:100%; border:0px; padding:1px; height:50px; background-image:url('images/bg-1.gif'); vertical-align:middle; } .footer { width:100%; height:24px; background-color:#E4E4E4; } </style> <title> Title </title> </head> <body> <div class="mainwrapper"> <div class="header"> </div><br /> <div class="loginarea"> Username:<input type="text" name="username" /> Password:<input type="password" password="password" /> </div><br /> <div class="footer"> </div> </div> </body></html> Link to comment Share on other sites More sharing options...
BiteMe Posted September 19, 2006 Share Posted September 19, 2006 Well you could let us know what it is you are trying to achive!Are you trying to get the login boxes to go in that grey strip? Link to comment Share on other sites More sharing options...
Cronthenoob Posted September 19, 2006 Author Share Posted September 19, 2006 The login boxes should be vertically centered in the login div. Link to comment Share on other sites More sharing options...
scott100 Posted September 19, 2006 Share Posted September 19, 2006 The login boxes should be vertically centered in the login div.I think you misunderstand what vertical-align is, it applies only to inline elements not block.It's not a substitute for html v-align which is used with tables for example when aligning elements.This example is a good visual of what it's about: http://www.htmlhelp.com/reference/css/text...ical-align.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now