1

I am trying to eradicate my HTML code of tags such as <strong>, <i>, <b>, and <em>. I understand that <strong> and <b> can be accomplished in CSS by using font-weight: bold. I also understand that <italic> can be accomplished in CSS by using font-weight: italic. However, I am not sure how what the CSS equivalent for <em> is. After a lot of research, I really do not even see the difference between <strong>, <b>, and <em>.

Therefore, what is the difference between <strong>, <b>, and <em>, and what is the CSS equivalent of <em>? Any suggestions are appreciated. Thank you.

SamSmith
  • 167
  • 1
  • 3
  • 13
  • In CSS, I guess you could use font-weight property! – kiner_shah Sep 07 '16 at 14:08
  • https://developer.mozilla.org/ru/docs/Web/HTML/Element/em ... Read the part * vs. * .... don't replace that tags are usefull for accessibility ... Visually em is just italic – DaniP Sep 07 '16 at 14:08
  • I'm sure you have a very good reason to not use the semantic tags, but for anyone reading this afterwards – you should use semantically meaningful tags unless you have a *very good reason* not to. – JJJ Sep 07 '16 at 14:10
  • Also, you could just inspect an `` tag with the browser's dev tools and see what default styles are applied to it. – JJJ Sep 07 '16 at 14:10
  • ` and `` tell your browser to highlight the text in such away that makes it more apparent and striking, which 95% of the time means bold or italic, *however*, in some instances it does not. An example is for many Text-To-Speech programs. `` means specifically bold - they will notice no difference, however `` and `` may be expressed with certain inflection or emphasis. `` and `` are *methods*, whereas `` and `` are specific styles. – Tyler Roper Sep 07 '16 at 14:11

2 Answers2

3

The em tag is a semantic tag for "emphasis" which most browsers render as font-style: italic:

JS Fiddle


Most browsers will display the element with the following default values:

em { 
    font-style: italic;
}

Source: HTML em tag

Derek Story
  • 9,518
  • 1
  • 24
  • 34
1

basically, <strong> and <em> are SEO equivalents of <b> and <i> - by default they are styled the same, but the first ones give more power to the context

to answer your second question - you can style element as <em> by applying font-style: italic

pwolaq
  • 6,343
  • 19
  • 45