Is it ok to use in place of blindly?

前端 未结 8 812
清歌不尽
清歌不尽 2020-12-02 15:38

Note: I know is presentational and is a better way, and

相关标签:
8条回答
  • 2020-12-02 16:07

    As others have said there's a semantic difference between strong/b and i/em. Especially they are used by screenreaders for visually impaired people visiting your website. For them it makes a huge difference if you just make some text bold-face, or if you want to add some kind of EMphasis to what you're saying on your website. So be sure to carefully consider making something bold using B or STRONG. The same goes for EM and I.

    0 讨论(0)
  • 2020-12-02 16:12

    Is it ok to use <strong> in place of <b> blindly?

    No.

    To quote Anne van Kesteren (source):

    Let me give some contradictory advice. Please do replace em with i and strong with b. The resulting markup is likely more accurate. Especially with WYSIWYG software it is extremely unlikely they will be used correctly, but also because the notion spread that they are interchangeable with the sole difference being that strong and em are semantic a lot of misuse happened. When in doubt, use i and b.

    And he’s right, of course. strong and b are not the same. em and i are not the same. Only use strong / em if you want to add semantical emphasis to text.

    0 讨论(0)
提交回复
热议问题