0

我的问题是按钮/输入没有留在登录背景框/表格中......我尝试了一切,但它只是不会留在......并且当你调整大小时 login_bg 应该移动并且输入必须留在其中网页浏览器

这是我的 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/

也许我没问好,所以如果你想知道什么可以帮助你更多地了解我,就问吧。谢谢!

4

1 回答 1

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;
}
于 2013-06-05T22:41:47.827 回答