<p class="sougouContent"> </p> <p class="tag"> css background-position td </p> 用background-position显示背景图,在div里显示正常,放到td里就什么都不显示了。请大家帮忙看看。 <br> 代码贴出,使用的图片也贴出来了。 <br> <br> <br> <style> <br /> #div_WS10_root .LeftBracket { <br /> background-image: url(../Images/Mental/codingOver8.jpg); <br /> background-attachment: fixed; <br /> background-repeat: no-repeat; <br /> background-position: -45px 10px; <br /> width: 45px; <br /> height: 45px; <br /> display: block; <br /> border: 1px solid green; <br /> } <br /> <br /> #div_WS10_root .RightBracket { <br /> background-image: url(../Images/Mental/codingOver8.jpg); <br /> background-attachment: fixed; <br /> background-repeat: no-repeat; <br /> background-position: 0px 10px; <br /> width: 45px; <br /> height: 45px; <br /> display: block; <br /> border: 1px solid green; <br /> } <br /> <br /> #table_sample { <br /> width:405px; <br /> } <br /> #table_sample tr td { <br /> text-align: center; <br /> vertical-align: middle; <br /> border-color:#ddd; <br /> padding:0px; <br /> margin:0px; <br /> width:45px; <br /> height:45px; <br /> border:1px solid black; <br /> } <br /> <br /> </style> <br> <br> <div> <br> <br> <div></div> <br> <div> <br> <br> <div> <br> <div> <br> <button>计时开始</button> <br> <label>00:00:00</label> <br> </div> <br> <br> <div> <br> </div> <br> <br> <table> <br> <tr> <br> <td>1</td> <br> <td>2</td> <br> <td>3</td> <br> <td>4</td> <br> <td>5</td> <br> <td>6</td> <br> <td>7</td> <br> <td>8</td> <br> <td>9</td> <br> </tr> <br> <br> <tr> <br> <td> <br> <div></div> <br> </td> <br> <td> <br> <div></div> <br> </td> <br> <td></td> <br> <td></td> <br> <td></td> <br> <td></td> <br> <td></td> <br> <td></td> <br> <td></td> <br> </tr> <br> </table> <br> </div> <br> </div> <br> </div> <br> <br> <h2>回复讨论(解决方案)</h2> <p class="sougouAnswer"> background-attachment: fixed; //这个去掉看看 </p>