css background-position td
用background-position显示背景图,在div里显示正常,放到td里就什么都不显示了。请大家帮忙看看。
代码贴出,使用的图片也贴出来了。
#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;
}
1
2
3
4
5
6
7
8
9
回复讨论(解决方案)
background-attachment: fixed; //这个去掉看看