用JS代码拼接图片后,怎么让拼接后的整个图像作为一个层的背景?

解决方案 »

  1.   

    通过background-position给定位,比较麻烦我个人感觉
      

  2.   

    图片素材发给我好么[email protected]
      

  3.   

    这是最简单的解决方案了
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档</title>
        <style type="text/css">
            body
            {
             margin:0;
            }
            #div1
            {
                background: url(1.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div2
            {
                background: url(2.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div3
            {
                background: url(3.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div4
            {
                background: url(4.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div5
            {
                background: url(5.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div6
            {
                background: url(6.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div7
            {
                background: url(7.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div8
            {
                background: url(8.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
            #div9
            {
                background: url(9.jpg);
                width: 250px;
                height: 176px;
                float:left;
            }
        </style>    <script type="text/javascript">    </script></head>
    <body>
        <div style="width:750px;z-index:1">
            <div id="div1">
            </div>
            <div id="div2">
            </div>
            <div id="div3">
            </div>
            <div id="div4">
            </div>
            <div id="div5">
            </div>
            <div id="div6">
            </div>
            <div id="div7">
            </div>
            <div id="div8">
            </div>
            <div id="div9">
            </div>
        </div>
        <div style="position:absolute;left:0px;height:0px;width:750px;height:528px;">中华人名共和国</div>
    </body>
    </html>