好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

我在用CSS编一个表格,想把背景图片加到表头里,而表单的背景是空白的,具体代码和相关信息如下。在线等


body,table{
font-size:12px;
}

table{
table-layout:fixed;
empty-cells:show;
border-collapse: collapse;
margin:0 auto;
}
td{
height:20px;
}
h1,h2,h3{
font-size:12px;
margin:0;
padding:0;
}
.title { background: #FFF; border: 1px solid #9DB3C5; padding: 1px; width:90%;margin:20px auto; }
.title h1 { line-height: 31px; text-align:center; background: #2F589C url(th_bg2.gif); background-repeat: repeat-x; background-position: 0 0; color: #FFF; }
.title th, .title td { border: 1px solid #CAD9EA; padding: 5px; }



table.t1{
font-family: sans-serif;
border:1px solid #cad9ea;
color:#696969;
}
table.t1 th {
background-image: url(th_bg9.gif);
background-repeat::repeat-x;
height:30px;
}
table.t1 td,table.t1 th{
border:1px solid #cad9ea;
padding:0 1em 0;
}
table.t1 tr.a1{
background-color:#DCDCDC;
}
-->




.nav
{
background-image:url("images/home.jpg") no-repeat;
}


1111
1111
1111
1111


这个NAV的例子我是在网上找到的,用了之后完全没效果,请各位大神帮忙!


回复讨论(解决方案)


.nav
{
background-image:url("images/home.jpg") no-repeat;
}


放到表格外面去,

然后改成
.nav
{
background:url("images/home.jpg") no-repeat;
}

background-image是不能写 no-repeat的background才可以

老大 我放到表格外边了 可还是没效果 是不是我放错位置了? 你告诉一下我具体放到哪儿吧 谢谢了
.nav
{
background-image:url("images/home.jpg") no-repeat;
}


放到表格外面去,

然后改成
.nav
{
background:url("images/home.jpg") no-repeat;
}

background-image是不能写 no……

例子

 body,table{  font-size:12px;} table{  table-layout:fixed;  empty-cells:show;   border-collapse: collapse;  margin:0 auto;}td{  height:20px;}h1,h2,h3{  font-size:12px;  margin:0;  padding:0;}.title { background: #FFF; border: 1px solid #9DB3C5; padding: 1px; width:90%;margin:20px auto; }  .title h1 { line-height: 31px; text-align:center; background: #2F589C url(th_bg2.gif); background-repeat: repeat-x; background-position: 0 0; color: #FFF; }  .title th, .title td { border: 1px solid #CAD9EA; padding: 5px; }   table.t1{  font-family: sans-serif;  border:1px solid #cad9ea;  color:#696969;}table.t1 th {  height:30px;}table.t1 td,table.t1 th{  border:1px solid #cad9ea;  padding:0 1em 0;}table.t1 tr.a1{  background-color:#DCDCDC;}  .nav  {  background:url("http://HdhCmsTestfjms.net/pic/vImage/2008-08/20080806122054907875.jpg") no-repeat;  }           1111    1111    1111    1111        

我解决了 不过nav还是没用上 我把背景图片加到table里了 能实现了。。。 例子

HTML code

body,table{
font-size:12px;
}

table{
table-layout:fixed;
empty-cells:show;
border-collapse: collapse;
margin:0 auto;
}
td{
height:20……

查看更多关于我在用CSS编一个表格,想把背景图片加到表头里,而表单的背景是空白的,具体代码和相关信息如下。在线等的详细内容...

  阅读:32次