HTML Logical Tags

There are two tags in HTML which are often confused: <b> and <strong> (also <i> and <em> but rather than type everything twice I’m just going to talk about b and strong for now). If you enclose some text within a pair of “b” tags then it will be displayed as bold text. If you enclose the same text in a pair of “strong tags then it will also (most of the time) be displayed as bold text. So what’s the difference? And why should you care?

<b>
The bold tag (<b>) makes the text within it bold. That’s what it does – the bold tag, it makes things bold. You can’t really get much simpler than that and I really like it. It changes how the text is displayed. When programming for any length of time you will come to treasure these rare things which actually DO WHAT THEY’RE SUPPOSED TO! Ahem…

<strong>
The strong tag works in a different way. Rather than changing how the text is to be displayed it defines what this text is and how it is to be treated. It is, in effect, saying “this bit of text here needs a strong emphasis. Bold face will probably do, but if that’s not available, say if there’s a blind person using a html text reader, then use some other way of emphasising it. Such as shouting.”

At the end of the day they will both usually do the same thing, but try and get used to using the strong tag unless it’s for purely visual reasons.

Advertisements

About Mr Chimp

I make music, draw pictures, browse the internet, programme, and make sweet, sweet cups of tea until the early hours.
This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s