Suppose you have a table and you need to give styles to all the <TD> tags. Using inheritance to do this helps you avoid generating more content to be delivered to the client. Take this code, for example:

在CSS中使用继承<table>
在CSS中使用继承
<td class=Cell></td>
在CSS中使用继承
<td class=Cell></td>
在CSS中使用继承
<td class=Cell></td>
在CSS中使用继承
</table>

This can be replaced with the following style sheet :
在CSS中使用继承Table.Cell TD
}


在CSS中使用继承<table class=Cell>
在CSS中使用继承
<td ></td>
在CSS中使用继承
<td ></td>
在CSS中使用继承
<td ></td>
在CSS中使用继承
</table>
This way, there's less code to download and it's easier to maintain.
From Devx:Prasad Haridass

相关文章:

  • 2022-12-23
  • 2021-11-30
  • 2021-12-31
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2021-09-20
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-11-04
相关资源
相似解决方案