0

我在 CSS 和 HTML 中工作......一切看起来都很好,但是当我调整窗口时,文本框和按钮移动了位置。我希望在调整窗口大小时一切都保持原位..帮助..我尝试使用我看过的其他地方建议的包装器,但我认为我要么做错了,要么它不起作用。

这是该网站,因此您可以更好地了解我在说什么... http://www.difgropliego.comze.com/diflogin.html

<html>
<head>
    <style>
    #wrapper {
        width: 800px; 
        margin:0 auto;
    }

    body {
        background-color:black;
        background-image:url(diflogin.png);
        background-repeat:no-repeat;
        background-position:center top; 
        margin:0 10% 0 10%;
        padding:0 0 0 0;
        border:0 0 0 0;
    }

    #user {
        position:absolute;
        left: 306px;
        top: 455px;
    }

    #contra {
        position: absolute;
        left: 904px;
        top: 455px;
    }

    #web-buttons-idgi5a2 {
        position: absolute;
        left: 1023px;
        top: 601px;
    }

    #web-buttons-idgi5a2 a {
        display:block;
    }

    #web-buttons-idgi5a2 a:hover {
        background-position:left bottom;
    }

    a #web-buttons-idgi5a2a {
        display:none
    }
    </style>
</head>
<body>
    <div id="wrapper">
        <label for="user"></label>
        <input type="text" name="user" id="user" />
        <label for="contra"></label>
        <input type="text" name="contra" id="contra" />

        <table id="web-buttons-idgi5a2" width=0 cellpadding=0 cellspacing=0 border=0>
            <tr>
                <td style="padding-right:0px" title ="INGRESAR">
                    <a href="#" title="INGRESAR" style="background-image:url(buttoning.png);width:160px;height:61px;display:block;"><br/></a>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
4

1 回答 1

0

对于您的输入,如果您希望它们保持显示在屏幕上,请尝试使用如下百分比:

#user{
    position:absolute;
    left: 10%;
    top: 20%;
}
于 2013-05-13T21:09:11.713 回答