When dealing with an order of precedence, I understand that:
1) inline style in the style attribute takes precedence over the same style in a class where the class is on the page
2) the style in the class on the page takes precedence over the same style that is in a class in a css file
But what about if you have something like:
<tr class="rowstyle startRowstyle">
where the styles are in different classes on the same page or in different classes in the same css file.
<style type="text/css">
.startRowstyle
{
background-color: Green ;
}
.rowstyle
{
background-color: Blue;
}
</style>
I was under the impression the order was defined by the order in the class statement where the last one defined in the class statement would override the first one.
But that doesn't seem to be the case.
In my example, the class statement in my <tr> tag has the order (Blue, Green). So I would expect that the table would have Green rows. But it doesn't seem to. The order in my styles has Green first and Blue second and my table is Blue.
If I don't change the order in the class statement and reverse the order in the Style section where Green now follows the Blue, the table is Green.
So the order is not dictated by the order in the class attribute but by the order of precedence either in the styles on the page or the order in the styles sheet.
Is this correct?
Thanks,
Tom
1) inline style in the style attribute takes precedence over the same style in a class where the class is on the page
2) the style in the class on the page takes precedence over the same style that is in a class in a css file
But what about if you have something like:
<tr class="rowstyle startRowstyle">
where the styles are in different classes on the same page or in different classes in the same css file.
<style type="text/css">
.startRowstyle
{
background-color: Green ;
}
.rowstyle
{
background-color: Blue;
}
</style>
I was under the impression the order was defined by the order in the class statement where the last one defined in the class statement would override the first one.
But that doesn't seem to be the case.
In my example, the class statement in my <tr> tag has the order (Blue, Green). So I would expect that the table would have Green rows. But it doesn't seem to. The order in my styles has Green first and Blue second and my table is Blue.
If I don't change the order in the class statement and reverse the order in the Style section where Green now follows the Blue, the table is Green.
So the order is not dictated by the order in the class attribute but by the order of precedence either in the styles on the page or the order in the styles sheet.
Is this correct?
Thanks,
Tom