Program Tip

programtip 2020. 9. 29. 18:27
반응형

, 그리고 의 차이점은 무엇입니까 ?


<b><strong>, <i>그리고 <em>HTML / XHTML 의 차이점은 무엇입니까 ? 언제 각각을 사용해야합니까?


그들은이 일반 웹 브라우저 렌더링 엔진에 동일한 효과를 하지만,이 근본적인 차이 그들 사이는.

저자 가 토론 목록 게시물에 다음 과 같이 썼습니다 .

세 가지 다른 상황을 생각해보십시오.

  • 웹 브라우저
  • 시각 장애인
  • 휴대 전화

"Bold"는 스타일입니다. "bold a word" 라고 말하면 사람들은 기본적으로 다른 글자 사이에서 더 두드러 질 때까지 글자 주위에 더 많은 것을 추가하는 것을 의미한다는 것을 알고 있습니다. "잉크"라고합시다.

불행히도 그것은 시각 장애인에게는 아무 의미가 없습니다. 휴대폰 및 기타 PDA에서는 화면 해상도가 매우 작기 때문에 텍스트가 이미 굵게 표시됩니다. 무언가를 망치지 않고는 대담한 사람을 대담하게 만들 수 없습니다.

<b>스타일입니다 -우리는 "굵게"가 어떻게 생겼는지 알고 있습니다.

<strong>그러나 무엇인가를 어떻게 이해해야하는지에 대한 표시입니다 . "강함"은 브라우저에서 "굵게"를 의미 할 수 있습니다 (그리고 종종 그렇습니다). 그러나 Jaws (맹인용)와 같은 말하기 프로그램의 경우 낮은 톤을 의미하거나 밑줄로 표시 될 수도 있습니다 (굵게 표시 할 수 없기 때문). 굵게) Palm Pilot에서.

HTML은 스타일에 관한 것이 아닙니다. 수행 어떤 검색을 위해 "팀 버너스 - 리""시맨틱 웹." <strong>의미 - 그것은 주변의 텍스트 설명입니다 (예를 들어, "이 텍스트가 표시 한 텍스트의 나머지 부분보다 더 강한해야한다" 설명 반대) 하는 방법 은 주변 텍스트가 표시되어야합니다 (예를 들어, "이 텍스트는해야한다 굵게 " ).


<b><i>명시 적 - 그들은 각각 굵은 이탤릭체 지정합니다.

<strong>그리고 <em>의미 론적-그들은 포함 된 텍스트가 어떤 방식 으로든 "강하게"또는 "강조"되어야한다고 지정합니다. 일반적으로 굵게 및 기울임 꼴이지만 실제 스타일이 CSS를 통해 제어 될 수 있도록 허용합니다. 따라서 이들은 최신 웹 페이지에서 선호됩니다.


<strong><em>문서에 여분의 의미 론적 의미를 추가합니다. 그들은 또한 텍스트에 굵은 이탤릭체 스타일을 제공합니다.

물론 CSS로 스타일을 재정의 할 수 있습니다.

<b>그리고 <i>다른 한편으로 전용 글꼴 스타일을 적용하고 더 이상 사용되지해야합니다. (CSS로 형식을 지정해야하므로 텍스트가 실제로 중요하다면 어쨌든 "강하게"또는 "강조"로 만들 것입니다!)

이해가 되길 바랍니다.


다음은 권장 사용법과 정의 요약입니다.

<b>...주의가 여분의 중요성을 전달하지 않고 같은 다른 음성 또는 분위기, 전혀 의미와 실용적인 목적으로 그려지되는 텍스트 범위 핵심 단어 문서 초록, 제품 이름 리뷰, 실행 가능한 단어 에서 대화 형 텍스트 기반 소프트웨어 또는 기사 주도 .

<strong> ... 이제는 강한 강조보다는 중요성을 나타냅니다.

<i>... 대체 음성 또는 분위기의 텍스트 범위 또는 분류 학적 지정 , 기술 용어 , 다른 언어관용구 , 생각 과 같이 텍스트의 다른 품질을 나타내는 방식으로 일반 산문에서 오프셋 , 또는 서양 텍스트 선박 이름 .

<em> ... 강조를 나타냅니다.

(이것들은 모두 W3C 소스에서 직접 인용 한 것이며 제가 강조한 내용이 추가되었습니다. 참조 : https://rawgithub.com/whatwg/html-differences/master/Overview.html#changed-elementshttp://www.w3.org /TR/html401/struct/text.html#h-9.2.1 원본)


<b><i>둘 다 스타일과 관련이 있지만 <em><strong>의미 론적입니다. HTML 4에서 첫 번째는 글꼴 스타일 요소 로 분류되고 후자는 구문 요소분류됩니다 .

올바르게 표시로서, <i>그리고 <em>브라우저가 종종 이탤릭체로 모두 렌더링하기 때문에 종종 유사한 것으로 간주됩니다. 그러나 사양에 <em> 따르면 강조<strong> 나타내고 더 강한 강조를 나타냅니다 . 이는 매우 명확하지만 종종 잘못 해석됩니다. 다른 한편으로, 언제 사용 <i>하거나 <b>실제로 스타일의 문제입니다.


동안 <strong><em>물론 더 의미 론적으로 올바른으로하며, 사용에 확실한 정당한 이유가 보인다 <b><i>고객이 작성한 내용 태그.

이러한 내용에서 단어 나 구는 굵게 또는 기울임 꼴로 표시 될 수 있으며 일반적으로 이러한 굵게 또는 기울임 꼴에 대한 의미 론적 추론을 분석하는 것은 우리에게 달려 있지 않습니다.

또한, 이러한 콘텐츠는 특정 의미를 전달하기 위해 굵은 이탤릭체로 표시된 단어와 구를 참조 할 수 있습니다.

예를 들어 학생에게 굵은 단어를 대체하도록 지시하는 영어 시험 문제가 있습니다.


<em>그리고 <strong>보다 더 많은 대역폭을 소비 <i>하고 <b>.

또한 더 많은 입력이 필요합니다 (자동 생성되지 않은 경우).

They also clutter the editor screen with more text. I seem to recall that programmers like smaller source files if they are the same. (And let's be real, they are the same. Yes, there are "technical" (<i>cough</i>, ahem, excuse me) differences, but that's mostly phony to begin with.)

With any of the above tags, you can use style sheets to customize how they appear to however you want if you need them to appear different than their defaults renderings.


As others have said <b> and <i> are explicit (i.e. "make this text bold"), whereas <strong> and <em> are semantic (i.e. "this text should be emphasised").

In the context of a modern web-browser, it's difficult to see the difference (they both appear to produce the same result, right?), but think about screen readers for the visually impaired. If a screen-reader came across an <i> tag, it wouldn't know what to do. But if it comes across a <em> tag, it knows that whatever is within should be emphasised to the listener. And therein you get the practical difference.


<i>, <b>, <em> and <strong> tags are traditionally representational. But they have been given new semantic meaning in HTML5.

<i> and <b> was used for font style in HTML4. <i> was used for italic and <b> for bold. In HTML5 <i> tag has new semantic meaning of 'alternate voice or mood' and <b> tag has the meaning of stylistically offset.

Example uses of <i> tag are - taxonomic designation, technical term, idiomatic phrase from another language, transliteration, a thought, ship names in western texts. Such as -

<p><i>I hope this works</i>, he thought.</p>

Example uses of <b> tag are keywords in a document extract, product names in a review, actionable words in an interactive text driven software, article lead.

The following example paragraph is stylistically offset from the paragraphs that follow it.

<p><b class="lead">The event takes place this upcoming Saturday, and over 3,000 people have already registered.</b></p>

<em> and <strong> had the meaning of emphasis and strong emphasis in HTML4. But in HTML5 <em> means stressed emphasis and <strong> means strong importance.

In the following example there should be a linguistic change while reading the word before ...

<p>Make sure to sign up <em>before</em> the day of the event, September 16, 2016</p>

In the same example we can use the <strong> tag as follows ..

<p>Make sure to sign up <em>before</em> the day of the event, <strong>September 16, 2016</strong></p>

to give importance on the event date.

MDN Ref:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong


As the others have stated, the difference is that <b> and <i> hardcode font styles, whereas <strong> and <em> dictate semantic meaning, with the font style (or speaking browser intonation, or what-have-you) to be determined at the time the text is rendered (or spoken).

You can think of this as a difference between a “physical” font style and a “logical” style, if you will. At some later time, you may wish to change the way <strong> and <em> text are displayed, say, by altering properties in a style sheet to add color and size changes, or even to use different font faces entirely. If you've used “logical” markup instead of hardcoded “physical” markup, then you can simply change the display properties in one place each in your style sheet, and then all of the pages that reference that style sheet get changed automatically, without ever having to edit them.

Pretty slick, huh?

This is also the rationale behind defining sub-styles (referenced using the style= property in text tags) for paragraphs, table cells, header text, captions, etc., and using <div> tags. You can define physical representation for your logical styles in the style sheet, and the changes are automatically reflected in the web pages that reference that style sheet. Want a different representation for source code? Redefine the font, size, weight, spacing, etc. for your "code" style.

If you use XHTML, you can even define your own semantic tags, and your style sheet would do the conversions to physical font styles and layouts for you.


I use both <strong> and <b>, actually, for exactly the reasons mentioned in this thread of responses. There are times when bold-facing some text simply looks better, but it isn't, necessarily, semantically more important than the rest of the sentence. Here's an example from a page I'm working on right now:

"Retrieves <strong>all</strong> books about <b>lacrosse</b>."

In that sentence, the word "all" is very important, and "lacrosse" less so--I merely wanted it bold because it represents a search term, so I wanted some visual separation. If you're viewing the page with a screen reader, I really don't think it needs to go out of the way to emphasize the word "lacrosse".

I would tend to imagine that most web developers use one of the other, but both are fine--<b> is most definitely not deprecated, as some people have claimed. For me, it's just a fine line between visual appeal and meaning.


Use them only if using CSS style classes is for any reason unconvinient or impossible (like blog systems, allow only some tags to use in posts and eventually embedded styles). Another reason is support for very old browsers (some mobile devices?) or primitive search engines (that give points for <b> or <strong> tags, instead of analysing CSS styles).

If you can define CSS styles, use them.


<b> and <i> should be avoided because they describe the style of the text. Instead, use <strong> and <em> because that describes the semantics (the meaning) of the text.

As with all things in HTML, you should be thinking not about how you want it to look, but what you actually mean. Sure, it might just be bold and italics to you, but not to a screen reader.


b or i means you want the text to be rendered as bold or italics. strong or em means you want the text to be rendered in a way that the user understands as "important". The default is to render strong as bold and em as italics, but some other cultures might use a different mapping.

Like strings in a program, b and i would be "hard coded" while strong and em would be "localized".


"They have the same effect. However, XHTML, a cleaner, newer version of HTML, recommends the use of the <strong> tag. Strong is better because it is easier to read - its meaning is clearer. Additionally, <strong> conveys a meaning - showing the text strongly - while <b> (for bold) conveys a method - bolding the text. With strong, your code still makes sense if you use CSS stylesheets to change what the methods of making the text strong is.

The same goes for the difference between <i> and <em> ".

Google dixit:

http://wiki.answers.com/Q/What_is_the_difference_between_HTML_tags_b_and_strong


HTML Formatting Elements:

HTML also defines special elements for defining text with a special meaning. HTML uses elements like <b> and <i> for formatting output, like bold or italic text.

HTML Bold and Strong Formatting:

The HTML <b> element defines bold text, without any extra importance.

<b>This text is bold</b>

The HTML <strong> element defines strong text, with added semantic "strong" importance.

<strong>This text is strong</strong>

HTML Italic and Emphasized Formatting:

The HTML <i> element defines italic text, without any extra importance.

<i>This text is italic</i>

The HTML <em> element defines emphasized text, with added semantic importance.

<em>This text is emphasized</em>

You should generally try to avoid <b> and <i>. They were introduced for layouting the page (changing the way how it looks) in early HMTL versions prior to the creation of CSS, like the meanwhile removed font tag, and were mainly kept for backward compatibility and because some forums allow inline HTML and that's an easy way to change the look of text (like BBCode using [i], you can use <i> and so on).

Since the creation of CSS, layouting is actually nothing that should be done in HTML anymore, that's why CSS has been created in the first place (HTML == Structure, CSS == Layout). These tags may as well vanish in the future, after all you can just use CSS and span tags to make text bold/italic if you need a "meaningless" font variation. HTML 5 still allows them but declares that marking text that way has no meaning.

<em> and <strong> on the other hand only says that something is "emphasized" or "strongly emphasized", it leaves it completely open to the browser how to render it. Most browsers will render em as italic and strong as bold as the standard suggests by default, but they are not forced to do that (they may use different colors, font sizes, fonts, whatever). You can use CSS to change the behavior the way you desire. You can make em bold if you like and strong bold and red, for example.


<strong> and <em> are abstract (which is what people mean when they say it's semantic). <b> and <i> are specific ways of making something "strong" or "emphasized"

<strong> : <b> :: vehicle :: jeep


We use the <strong> tag for text which has high priority for SEO purposes like product name, company name etc, while <b> simple makes it bold.

Similarly, we use <em> for text which has high priority for SEO, while <i> to make the text simply italic.

참고URL : https://stackoverflow.com/questions/271743/whats-the-difference-between-b-and-strong-i-and-em

반응형