When is the best time to use b and i in lieu of strong and em if ever
htmlThe 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:
- strong: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
- em: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
- b: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b
- i: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i
Other Article on Tag html
- - convert HTML to XHTML
- - dynamically create html element in javascript
- - How to auto-size an iFrame
- - How to use google image url as src for image
- - .htm vs .html what is different?
- - HTML CSS insert line breaks in HTML documents
- - html css Remove border from IFrame
- - HTML Landscape printing
- - html layout
- - html textarea no change size