html - Trying to put my label above input type text -


i have login form, , im trying put span above input, im not having sucess doing this, tries, im having same result, is:

label: [input]

but want

label:

[input]

do know trick this? because default seems label aligned left..

this im trying: http://jsfiddle.net/8jkmm/ have html:

<div class="loginbox">     <h1>login:</h1>     <form name="login" action="" method="post">         <label class="label">             <span class="field">email:</span>             <input type="text" name="user" />         </label>          <div class="label">             <span class="field">pass:</span>             <input type="password" name="pass" class="pass" />             <input type="submit" value="login" class="btn" />              <a href="index.php?remember=true" class="link">forgot password<i class="fa fa-chevron-right"></i></a>         </div>             </form> </div> 

and css:

.loginbox{position:absolute; left:50%; top:50%; background:rgba(255,255,255,0.9); width:360px; height:265px;} .loginbox{margin-left:-180px; margin-top:-125px;} .loginbox h1{padding:20px; font-weight:200; color:#fff; background:pink;} .loginbox form{padding:20px;} .loginbox form .label{display:block; margin-bottom:10px;  width:320px;} .loginbox form .label .field{ width:60px; text-align:right; font-size:20px; margin:7px 10px 3px 3px;} .loginbox form .label input{padding:10px; font-size:16px; border:1px solid #ccc; width:225px;} .loginbox form .label .pass{width:225px;} .loginbox form .label .btn{float:right; width:auto; display:block;  border:none; font-size:14px; text-transform:uppercase; margin:15px auto;} .loginbox form .label .btn{padding:11px 10px 11px; color:#fff;  cursor:pointer;} .loginbox form .link {float:left;margin:15px auto;  color:#000;} 

you can display span (.loginbox form .label .field css class) element block instead of default inline :

.loginbox form .label .field{      display:block;      width:60px;      font-size:20px;      margin:7px 10px 3px 3px; } 

your html structure seems bit weird, although if want achieve same result posted should remove text-align:right.

example


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -