首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

background-position在td里不显示背景的有关问题

2013-07-09 
background-position在td里不显示背景的问题。用background-position显示背景图,在div里显示正常,放到td里

background-position在td里不显示背景的问题。
用background-position显示背景图,在div里显示正常,放到td里就什么都不显示了。请大家帮忙看看。
代码贴出,使用的图片也贴出来了。


<style type="text/css">
    #div_WS10_root .LeftBracket {
        background-image: url(../Images/Mental/codingOver8.jpg);
        background-attachment: fixed;
        background-repeat: no-repeat;
        background-position: -45px 10px;
        width: 45px;
        height: 45px;
        display: block;
        border: 1px solid green;
    }

    #div_WS10_root .RightBracket {
        background-image: url(../Images/Mental/codingOver8.jpg);
        background-attachment: fixed;
        background-repeat: no-repeat;
        background-position: 0px 10px;
        width: 45px;
        height: 45px;
        display: block;
        border: 1px solid green;
    }

    #table_sample {
        width:405px;
    }
    #table_sample tr td {
        text-align: center;
        vertical-align: middle;
        border-color:#ddd;
        padding:0px;
        margin:0px;
        width:45px;
        height:45px;
        border:1px solid black;
    }
 
</style>

<div id="div_WS10_root">

      <div class="RightBracket"></div>
    <div>

        <div>
            <div class="button-set">
                <button id="btn_WS10_Start" name="btnStart">计时开始</button>
                <label id="label_WS10_problemTimer" group="problemTimer" style="margin-left: 20px; font-weight: bold;">00:00:00</label>
            </div>

            <div>
            </div>

            <table id="table_sample">
                <tr>
                    <td>1</td>


                    <td>2</td>
                    <td>3</td>
                    <td>4</td>
                    <td>5</td>
                    <td>6</td>
                    <td>7</td>
                    <td>8</td>
                    <td>9</td>
                </tr>

                <tr>
                    <td>
                        <div class="RightBracket"></div>
                    </td>
                    <td>
                        <div class="LeftBracket"></div>
                    </td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </div>
    </div>
</div>
css background-position td


[解决办法]
 background-attachment: fixed; //这个去掉看看

热点排行