2011-12-15 112 views
1

在asp.net一个MVC应用程序中使用CSS,我认为我有一个表:在MVC应用程序

<table width="100%" class="personRow"> 

    <tr class="personRowHeader"> 

     <td style="width: 40%;"> Subiect </td> ... 

和表我使用样式代码PersonRow,一个用于personRowHeader这样定义行:

table.personRow 
{ 
background-color:#EEEEEE; 
border:2px solid white; 
} 

table.personRow tr.personRowHeader 
{ 
    border-bottom-color : #FFFFFF; 
    border-bottom-style : solid; 
    border-bottom-width: medium; 
    font-weight: bold; 
    background-color: #CCCCFF; 
} 

当我只使用personrow我的页面设计中的表的设置进行了修改,但是当我使用我的行的设置时什么也没有发生。可以有人告诉我为什么不工作行的设置?

+0

使用像Firebug(任何其他网络调试器)来检查这些元素,很可能你有一些其他风格,干扰你的`.RedRow`类。 – tobias86 2011-12-15 09:52:37

回答

0

试试这个,让我知道它,它为你工作:

<table width="100%" class="personRow"> 

    <tr> 

     <td style="width: 40%;"> Subiect </td> . 

为你的CSS,使用此块

table.personRow 
{ 
background-color:#EEEEEE; 
border:2px solid white; 
} 

table.personRow tr 
{ 
    border-bottom-color : #FFFFFF; 
    border-bottom-style : solid; 
    border-bottom-width: medium; 
    font-weight: bold; 
    background-color: #CCCCFF; 
} 

我们迄今所做的取消需要明确地使用你的TR中的class属性,而让CSS通过指出table下的TR具有class of "personRow"来管理它,应该使用这种风格

+0

我修改了但仍然没有任何变化:( – Cr123 2011-12-15 12:01:51

1

我把你的代码放在jsfiddle中,只替换了更多可见颜色的颜色,但我没有看到任何错误。

http://jsfiddle.net/e9wvY/1/

检查出来自己,一切工作按预期。

+0

是的,我检查了自己所有的表代码,并在这个网站看起来很好,但在我的申请仍然没有工作。我的网页有一个集合页。我将cckck此页。如果我写这样的代码看起来不错:

Cr1232011-12-15 11:58:56

Subtitles