S
S
StrangeAttractor2010-10-25 19:53:05
HTML
StrangeAttractor, 2010-10-25 19:53:05

Which tags are kosher: em or i, strong or b?

There are HTML tags that are meant to (sort of) do the same thing and render the same way. For example pairs em and i, strong and b.

What formatting tags are “more correct” to use (where formatting with tags is appropriate - for example, when creating topics / comments here on Habré, on StackOverflow, etc.)?

I'm leaning towards em/strong myself. they are more, so to speak, semantic. On the other hand, i/b seems to be more concise.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
A
apangin, 2010-10-25
@apangin

In the W3C specification, the EM and STRONG tags are moved to the Structured Text -> Phrase Elements section.
    EM: Indicates emphasis.
    STRONG: Indicates stronger emphasis.
The appearance of how phrase elements will be displayed is determined by the browser. These tags can be taken into account, for example, by Text-to-Speech engines to change the intonation or volume of the voice.
At the same time, B and I refer to the Formatting -> Fonts section and give an explicit indication to the browser what font to render the fragment in.
    I: Renders as italic text style.
    B: Renders as bold text style.

P
Pavel Slyusar, 2010-10-25
@slesar

i / b - only visual design, do not carry a semantic load, sort of.

M
Mercury13, 2010-10-25
@Mercury13

In html5 it's about the same. The tags and have been redefined so that - subtle selection, - strong selection.

O
Oleg Torbasov, 2010-10-26
@torbasow

EM is for intonation stress. In the English tradition, such passages are italicized. In Russian, it is not customary to do this, and intonation stress is distinguished by the context, the construction of the sentence. Therefore, this tag is inappropriate for the layout of Russian texts.
STRONG is intended for semantic emphasis. And everything else (of the above), in my opinion, is from the evil one.
In HTML 4, this difference seems to me to be implied, but poorly expressed. But in HTML 5 it is very clear: stress emphasis (evaluate the examples!) and strong importance .

D
denisyukphp, 2010-10-26
@denisyukphp

I use i/b in layout elements, and em/strong when posting.

V
Vladimir Chernyshev, 2010-10-27
@VolCh

I use i and b for design decisions when using only CSS is inappropriate (for example, navigation, image captions, etc. - why select in a span that should be assigned bold, if you can select in b?), and strong and em mostly page content to highlight part of a phrase/paragraph/…

X
xalexx, 2010-10-27
@xalexx

There was a good article on the topic.

I
I.CaR Soft, 2017-11-27
@I_CaR

Single now.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question