2013-06-05 25 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

對我來說,最好使用表:/ –