0

请您协助我的查询。我正在尝试让阴影 png 与框的边缘对齐。我有 3 张图像伪装成阴影,最后一个阴影,即“top_right”,无论我如何尝试使用边距,都不会到位。以下是代码,我将不胜感激。

窗扇

    <style type="text/css">
body    {
            background-color:#e1f2ff;
            font-family:TW Cen MT;
            }

    h1  { color:#000;
    }

#footer {
    background-color:#313131;
        color:#fff;
        font-style:italic;
                    }
input#box {
            background:#efd2a7;
            font-size:10pt;
            }

        #content {

            background-width:600px;
                }


                    a:hover#butt    {
                        background:url("images/butt_over.png");
                            }

                #top_left {
                    margin-left:-17px;
                    {

                    #top_right {
                        margin-right:300px;
                        }


                    #bott {
                        margin-top:10px;
                        }
    </style>
    </head>

    <body>
    <div id="container" style="width:900px; height:900px;" align="center">

        <div id="header" align="center">
        <h2>We’re currently constructing our website.
    Please leave your name and e-mail address below and we will
    let you know when the site launches.
    You will also receive fantastic offers & a
    discount voucher for your time!</h2></div>

    <div id="content" style="background-color:#fff;height:450px;width:550px;">

    <img src="images/shad_top_left.png" id="top_left" style="float:left; vertical-align:top" >
    <img src="images/logo.png" width="300" height="100">
    <img src="images/shad_top_right.png" id="top_right" style="float:right;" ><br/>
    <h2>Send us your e-mail address</h2>
    <br/><br/> 
4

1 回答 1

0

代码中的 2 个错误首先你需要关闭左上角末尾的每个开放括号你打开了另一个括号而不是关闭了一个括号....也使用 position:absolute

            #top_left {
                margin-left:-17px;
                    } // you had put { here instead

                #top_right {
                    position: absolute;
                    margin-left :300px;
                    }
于 2014-12-26T11:56:50.317 回答