Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎁第7期第7题:b与strong的区别以及i和em的区别? #50

Open
LinDaiDai opened this issue Jul 8, 2020 · 0 comments
Open
Labels

Comments

@LinDaiDai
Copy link
Owner

b与strong的区别以及i和em的区别?

首先描述一下这四个标签的显示效果吧:

  • <b><strong>包裹的文字会被加粗
  • <i><em>包裹的文字会以斜体的方式呈现

HTML代码:

<b>霖呆呆</b>
<strong>霖呆呆</strong>
<i>霖呆呆</i>
<em>霖呆呆</em>

效果如下:

咱再来说说他们在语义上的区别吧。

  • <b>标签和<i>标签都是自然样式标签,都只是在样式上加粗和变斜,并没有什么实际的意义。并且据了解,这两种标签在HTML4.01中已经不被推荐使用了。
  • <strong>标签和<em>的话是语义样式标签。就像是<h1>、<h2>一样都有自己的语义。<em>表示一般的强调文本,而<strong>表示更强的强调文本。另外在使用阅读设备的时候,<strong>会重读(这点呆呆也没有实践过所以不太敢保证)。
@LinDaiDai LinDaiDai added the CSS label Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant