解决方案 »

  1.   


    <style type="text/css">
    .dd{
    background-image:url('http://www.csdn.net/css/logo.png');
    background-size:100% 100%;
    width:480px;
    height:180px;
    border:1px solid #FF0000;
    }
    </style><div class="dd"></div>
      

  2.   

    这个是CSS3,需要IE9及以上才支持。
      

  3.   

    用jQuery 获取宽度  在给div层的width属性赋值
      

  4.   

    兼容IE了。<style type="text/css">
    .dd{
        background-image:url('http://www.csdn.net/css/logo.png');
        background-size:100% 100%;
        width:480px;
        height:180px;
        border:1px solid #FF0000;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
        src='http://www.csdn.net/css/logo.png',
        sizingMethod='scale');
    }
    </style>
     
    <div class="dd"></div>