Not sure why there is obviously something wrong with this but my two of my divs username and #passwordrow are turning out twice the length of the parent #loginbox don't worry ablut the wierd backgroound and text colours I did that so I can see how they are acting, the first two divs #loginboxheading and #loginboxclose are the perfect sizes and are positioned fine its just the two below them.
The font colours and everything show up fine in them not text-align: centered though and twice the width can anyone see where I have gone wrong????
css
#loginbox {
position: absolute;
top: 33%;
left: 33%;
z-index:3;
visibility: hidden;
width: 400px;
height: 200px;
display: block;
background: #fff;
border: 1px solid #000;
}
#loginboxheading{
float: left;
width: 330px;
height: 30px;
line-height: 30px;
display: inline;
text-align: center;
color: #000;
vertical-align:middle;
font-size: 13px;
font-family: arial,tahoma;
font-weight: bold;
border: 1px solid #ff0000;
padding: 3px 0px 0px 30px;
}
#loginboxclose{
float: right;
width: 31px;
height: 30px;
text-align: center;
background: transparent;
border: 1px solid #ff0000;
margin: 0px 0px 0px 0px;
padding: 3px 5px 0px 0px;
}
#usernamerow{
float: right;
width: 390px;
height: 30px;
line-height: 30px;
display: inline;
vertical-align:middle;
text-align: center;
color: #ff0000;
font-size: 13px;
font-family: arial,tahoma;
font-weight: bold;
background: #000;
border: 1px solid #ff0000;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
#passwordrow{
float: right;
width: 390px;
height: 30px;
line-height: 30px;
display: inline;
vertical-align:middle;
text-align: center;
color: #ff0000;
font-size: 13px;
font-family: arial,tahoma;
font-weight: bold;
background: #ffff00;
border: 1px solid #ff0000;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 30px;
}
html
<div id="loginbox">
<div id="loginboxheading">Login Area</div>
<div id="loginboxclose"><a href="#" onclick="endlogin()"><img src="../pix/close.png" width="16" height="16" border="0" /></a></div>
<div id="usernamerow">Username</div>
<div id="passwordrow">Password</div>
</div>