请问下如何将图片设置为type为text的背景图片呢?急!!!!若能有用,马上给分。

解决方案 »

  1.   

    本帖最后由 net_lover 于 2012-04-05 13:45:56 编辑
      

  2.   

    <input type="text" style="background: url(image/one.jpg); background-repeat:no-repeat;" /> 
      

  3.   


    <script>
    function click(){
    document.getElementById("img1").src=document.getElementById("text1").value;
    }
    </script>
    <img id="img1" style="width:100px;height:100px;"/><br />
    <input type="text" id="text1" style="width:200px;" value="http://www.baidu.com/img/baidu_sylogo1.gif" />
    <input type="button" value="click me" onclick="click()"/>
      

  4.   

     
    或者用样式:<style type="text/css">
    body {
    background-image:url(/images/one.jpg);
    background-repeat:repeat-x;
    }
    </style>
      

  5.   

    百度搜索框 样式:#kw, .btn, .btn_wr, #mCon {
        background: url("http://su.bdimg.com/static/superpage/img/spis_031ddf34.png") no-repeat scroll 0 0 transparent;
    }直接设置背景图 就可以