When is the best time to use b and i in lieu of strong and em if ever

html

The b and i elements in HTML are used to apply bold and italic styles to text, respectively. The strong and em elements, on the other hand, are used to indicate the relative importance or emphasis of text.

It is generally considered best practice to use the strong and em elements rather than the b and i elements for these purposes. This is because the strong and em elements convey semantic meaning, while the b and i elements are purely presentational.

Using the strong element to indicate importance or emphasis can help make your content more accessible and easier to understand for users with disabilities or for translation. It can also make it easier for search engines to understand the content of your page.

The em element is used to indicate emphasis within a block of text, such as a sentence. It is similar to the i element, but conveys a different meaning. The em element is used to indicate emphasis within a block of text, while the i element is used to apply an italic style.

In general, it is best to use the strong and em elements to convey meaning and use CSS styles to apply visual styles such as bold or italic. This allows you to separate the content and the presentation of your page, which can make it easier to maintain and update.

For more information on the strong, em, b, and i elements, you can refer to the HTML documentation: