优先级

id,class,td还有html里的样式优先级问题。。。

#bgGreen{ }

.bgRed{ background-color: Red; }

td{ background-color: Black; }

 

<table>
<tbody>
<tr>
<td class="bgRed" id="bgGreen" style="background-color:yellow">内容</td>
</tr>

</tbody>

</table>

优先级: style>id>class>td

前提:无!important

原文地址:https://www.cnblogs.com/lyne11/p/6404200.html