2013-06-05 26 views
0

我的问题是,按钮/输入不停留在登录背景框/表... 我试过一切,但它只是不会留在.. 。而login_bg应该移动,并输入要留在它,而你所调整的web浏览器该按钮/输入不停留在登录背景框/表

这里是我的CSS:

@charset "utf-8"; 
body { 
    margin: 0 auto; 
    text-align: center; 
    background-image:url('http://img585.imageshack.us/img585/6834/backgroundyq.jpg'); 
    background-repeat:no-repeat; 
    background-attachment: fixed; 
/* cursor: url('../css/images/cursor.cur'), auto;*/ 
} 

.login_bg { 
    background-image: url('http://img838.imageshack.us/img838/6615/loginbgm.png'); 
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    background-position: center center; 
    position: relative; 
    width: 1920px; 
    height: 1080px; 
} 

.login_info { 
position: absolute; 
margin: 350px 0 0 250px; 
} 

.login_input { 
    background-color: transparent; 
    background-image: url('http://img856.imageshack.us/img856/8451/inputy.png'); 
    background-repeat: no-repeat; 
    border-top-width: 0px; 
    border-right-width: 0px; 
    border-bottom-width: 0px; 
    border-left-width: 0px; 
    border-top-style: solid; 
    border-right-style: solid; 
    border-bottom-style: solid; 
    border-left-style: solid; 
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 14px; 
    color: #666666; 
    width: 250px; 
    position: fixed; 
    top: 250px; 
    left: 130px; 
    height: 37px; 
    font-weight: bold; 
} 

而这里的HTML代码。

<div class="login_bg"> 
<table class="login_info"> 
    <tr> 
    <td height="32"><input type="text" name="account" id="account" class="login_input" tabindex="1">&nbsp;</td> 
    </tr> 
</table> 
</div> 
</body> 

这里的jsfiddle:http://jsfiddle.net/3TQMF/11/

也许我没有问,因此,如果你想知道什么东西会帮助你更了解我,就问我。谢谢!

+0

编辑标题。对于将来参考,请不要使用类似标题“CSS不合作”。 – walther

+1

你的位置'固定'在输入。那不会在任何地方移动。父母应该是亲戚,孩子可以是绝对的,可以随父母一起移动。 –

+0

不使用表格可能会有所帮助。 – n1xx1

回答

0

我认为你要找的更像是以下内容(如果我明白你的重点是保持登录栏居中)。我撕掉了一些CSS和摆脱了表:

<body> 
<div class="login_bg"> 
<input type="text" name="account" id="account" class="login_input" tabindex="1"/> 
</div> 
</body> 

和:

@charset "utf-8"; 
body { 

    background-image:url('http://img585.imageshack.us/img585/6834/backgroundyq.jpg'); 
    background-repeat:no-repeat; 
    background-attachment: fixed; 
/* cursor: url('../css/images/cursor.cur'), auto;*/ 
} 

.login_bg { 
    background-image: url('http://img838.imageshack.us/img838/6615/loginbgm.png'); 
    position: relative; 
    width: 872px; 
    height: 545px; 
} 

.login_input { 
    background-color: transparent; 
    background-image: url('http://img856.imageshack.us/img856/8451/inputy.png'); 
    background-repeat: no-repeat; 
    border-top-width: 0px; 
    border-right-width: 0px; 
    border-bottom-width: 0px; 
    border-left-width: 0px; 
    border-top-style: solid; 
    border-right-style: solid; 
    border-bottom-style: solid; 
    border-left-style: solid; 
    font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 14px; 
    color: #666666; 
    width: 250px; 
    position: relative; 
    left: 45%; 
    top: 50%; 
    font-weight: bold; 
} 
+0

我需要一个登录栏中的表......从2个方向......左侧和右侧...进入左侧,我想添加一些登录/密码的东西,并在右侧我想添加像修补程序的东西列表...所以这不是解决方案:/ –

+0

只需创建另一个div,如.login_input并将其移动到右侧。你不需要使用表格。 –

+0

对我来说,最好使用表:/ –