新手同问,这个有没有可能是样式默认的margin,border属性值不为0导致的?

解决方案 »

  1.   

    不知道楼中的“中间会空出一大段出来”是什么意思?
    是image跟span中间,还是因为span向右偏得太多?
    如果是image跟span的问题, 将span嵌套在bottom里不就解决了吗?
    如果是span向右偏得太多, 修改span1的left值
      

  2.   

    span是嵌套在bottom里面的  你仔细看看
    且也不是因为span偏得太多
    你把left:240px  改成24px看一下!
      

  3.   


    <style type="text/css">
    <!--
    body,td,th {
        font-size: 12px;
    }
    #oo{
    width:300px;
    height:30px;
    border:1px solid #000000;
    }.bottom{background-image:url(http://mat1.qq.com/ent/ent2007/ent2-02.gif);
    width:328px;
    height:31px;
    }
    .span1{
    cursor:hand;
    position:absolute;
    top:260px;
    float:left;
    width:13px;
    height:19px;
    left:240px;
    background-image:url(http://mat1.qq.com/ent/ent2007/ent2-04.gif);
    }
    -->
    </style>
    <script>
    function ss(){
    var bian= document.getElementById("oo")
    var xx=document.createElement("img")
    xx.setAttribute("id","image");
    xx.setAttribute("src","http://mat1.qq.com/ent/upday2008/06182.jpg")
    //xx.className="image"
    bian.appendChild(xx)
    var xx1=document.createElement("div")
    xx1.setAttribute("id","bottom");
    xx1.className="bottom"
    bian.appendChild(xx1)
    var bottom= document.getElementById("oo")
    var xx2=document.createElement("span")
    xx2.setAttribute("id","num1")bottom.appendChild(xx2)
    xx2.className="span1"
    }
    </script>
    <body onload="ss()">
    <div id="oo"></div></body>
      

  4.   

    不大明白吗
    只能用浮动层来绝对定位吗?
    span是bottom的子元素
    应该可以控制span在bottom里面的位置的
    如果这么改  应该怎么修改了
    梁超兄  指教下!