日期:2014-05-17  浏览次数:20641 次

如何让让背景显示中间部分

<style type="text/css">
 body,div,input{margin:0; padding:0}
 #body {position:absolute;background-image: url(bg-top-01-no-pp.jpg);background-repeat: no-repeat;background-position: center top;height:4772px;width:2400px;!important}
 #logo {position:relative;left:712px;height:125px;width:980px;top:10px;clear: none;}
 #logo2{position:absolute; top:43px; left:210px;}   
  </style>
  </head>
  <body>
  <div id="body">
    <div id="logo">
      <div id="logo2"><img src="nav-bar-tw.gif" /></div>
      <img src="wasdnav-bg.png" /></div>
  </div>
  </body>
  </html>

如何让让背景显示中间部分地下没拖动条
------解决方案--------------------
试试先把背景的中间部分截下来,然后在DIV中居中,调整上下MARGIN
------解决方案--------------------
{background-position:202px -19px;}
指定要选部分的坐标,第一个为水平位置,第二个为垂直位置。