Click here to Skip to main content
15,886,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on MVC3 Application. I want to apply css.
I created css class under Content folder and put reference of the CSS in _LayOut.cshtml and But not adjusting css.
my css class is like below
CSS
.tr GridViewStyle
{
   background-color:Blue;
}

and apply reference in _LayOut.cshtml like @Content.Style("MyStyleSheet.css", Url)

And apply css like
XML
<table>
<tr class="GridViewStyle"> 
</tr>
</table>

Am I doing something wrong?

Thanks in advance.
Posted
Updated 5-Apr-12 5:33am
v2
Comments
ZurdoDev 5-Apr-12 11:39am    
You may not be doing something wrong. Use the browser's developer tools to view the styles that are being applied and see where they are coming from. It may be a different style is being applied later in the process overwriting it.
Rachana Patel 5-Apr-12 14:17pm    
I forgot to mention that I am using BluePrint stuff in my project, that might be a problem.
Rachana Patel 5-Apr-12 14:59pm    
I found the solutin for that But facing new problem I want to apply alternaterow style to table, I am not able to do that.
Solution for my first problem is
My css like below
.GridViewStyle tr
{
background-color:Blue;
}

and apply css like below:
<div class="container GridViewStyle">
<table>
<tr>
</td>
</table>
</div>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900