Can I use <strong> instead of <b> blindly?
Note: I know that <b> is presentation, and <span style="font-weight:bold> is the best way, and <strong> and <em> are for emphasis, but my question is not about that.
Should we convert everything <b> to <strong> blindly? Many people do this, they think that <b> doesn’t comply with website standards, so they convert every <b> to <strong> when redesigning the site, redistributing content, new website design, and people also offer it to others.
Dreamweaver also provided the ability to convert all <b> and <i> to <strong> and <em> when inserting code into a design view and when we use B and I that people use blindly.
alt text http://shup.com/Shup/280420/1101118332-My-Desktop.png
Both Dreamweaver (if the checkbox is specified above) and many WYSIWYG online editors display output in <strong> and <em> , and the button shows B and I.
alt text http://shup.com/Shup/280425/1101118921-My-Desktop.png
In my opinion, this creates a misconception about <strong> and <b>
When we receive content from a client, we don’t know where the client wants to emphasize and where he simply wants to use bold text for presentation purposes. What should we do in this case? No one has the time to give a decision for each instance (us and the client), whether it should be <b> or <strong> , <i> or <em>
What are the pros and cons of converting all <b> and <i> to <strong> and <em> blindly if we say our site is accessible?
Update: remember <b> and <i> not outdated, they are specified in the HTML 5 specification
As already mentioned, using <strong >, <em> , <cite> , etc. adds semantics, and this is important because you say something about why you want to emphasize something, and increases the readability of your html, because you know why it is bold.
In addition, screen readers use strong tags to hear the difference when reading aloud.
Perhaps you could think of introducing audio as a guide. If you want the difference when reading out loud, mark it as <strong> , for example, if you are not using <b> .
Then a rendering problem arises: I really don't know if all browsers will render <strong> as bold, and if it stays that way.
In short: <strong> No </strong> .
Can I use
<strong>instead of<b>blindly ?
No.
To quote Anne van Kesteren ( source ):
Let me give you some conflicting advice. Please replace
emwithiandstrongwithb. The resulting markup is most likely more accurate. Especially with WYSIWYG software it is extremely unlikely that they will be used correctly, but also because the concept extends that they are interchangeable with the only difference being thatstrongandemare semantic, that a lot of abuse has occurred . If in doubt, useiandb.
And, of course, right. strong and b do not match. em and i do not match. Use only strong / em if you want to add a semantic emphasis to the text.
<b> , <i> , <tt> are strictly typographic.
Speaking of typography, I don't mean visual. I mean the semantics expressed by the look. They need additional context in order to have a specific meaning (e.g. definition, e.g.:
- text in italics ...
or based on a typographic convention, for example, text in bold is eye traps, and italics are contextual changes). In typographic conventions, bold fonts in italics are marked in bold.
(for example [this one has another context]) for example this has a different context
These tags represent the port of a traditional printing press, in which semantics are conveyed by a specific visual representation.
As you pointed out, they are considered deprecated, but not in XHTML5. What for? I think, basically, that web content is intended not only for electronic media. If you are printing a web document, these tags can replace the syntax of some expressions used, for example, in TeX .
<strong> and <em> strictly refer to semantics,
telling how the text should be read and emphasized.
So, to repeat, none of these tags means the same as the others, so they should not even be used, but cannot be used interchangeably and are not replaced. In particular, blindly.
AFIR, Dreamweaver is not a WYSIWYM editor model. I have always believed that this is a new generation of FrontPage thinking (ease of use and something to do now, and forget about the future and scalability).
So, I understand the surprise here, and your delusion is correct :)
We should not change b and strong blindly, since they have a different purpose.
<b > and <i> are not presentation elements according to the HTML5 specification. They have a different meaning and purpose. Quoting the HTML5 specs,
Element b is an interval of text that should be stylistically offset from ordinary prose without any additional importance, such as keywords in the abstract of the document, product names in the review or other spaces of the text, a typical typographic representation of which is highlighted.
and for element i ,
Element i represents a range of text in an alternative voice or mood, or is otherwise compensated by normal prose, such as a taxonomic designation, technical term, idiomatic phrase from another language, thought, ship name or other prose, typical typographic presentation in italics.
As others have well clarified, i and em cannot be used interchangeably, and this happens with b and strong .
Intended use of i and b is very rare. (for example, in an interactive script, abstracts, resumes)
Literature:
If you just want to use bold text, make it bold using css. If a bold font has no semantic meaning, you should not use <strong> or <em> . However, you should not use <b> or <i> either because they are not semantic (in fact they are font style tags) and therefore their use is discouraged, if not even out of date .
<b> and <strong> do not necessarily match. <strong> , as you suggested, for higher attention, while <b> are for styling only. Therefore, you should not switch them blindly.
Some people will say that the <b> out of date, but it isn’t. He is still alive and kicked . However; it is not very semantic, as you say, so it’s better to use <span> and style it.
As others have said, there is a semantic difference between the strong / b and i / em. They are especially used for screen reading for visually impaired people visiting your site. For them, this is of great importance if you just make some text a bold face or want to add some kind of emotion to what you say on your site. So be sure to think carefully about doing something bold using B or STRONG. The same goes for EM and I.
There are some excellent answers here, but for those of you that are still not entirely clear and need further explanation and example, I found a useful explanation for this in HTML Text, Web Platform Documentation . The tutorial explains the difference in usage between <strong> and <b> bit later than half the page and gives examples.