Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 16th, 2006, 03:55 PM
Alan Silver
Guest
 
Posts: n/a
Default Eric Meyer uses <b> - isn't there a better way?

Hello,

In an attempt to get my head around this CSS business, I have been
reading Eric Meyer's two "on CSS" books. All seems clear and sensible,
but I have a question which the good folks here might be able to answer.

I thought that one of the great benefits of CSS was to allow you to mark
up the document so that the semantic meaning was clear, and then use the
CSS for display. In a couple of projects (one in each book), EM has HTML
like this (air code, so it's not exactly what he had)...

<div id="links">
<a href="fred.html">Fred</a><b>|</b>
<a href="john.html">John</a><b>|</b>
<a href="jim.html">Jim</a><b>|</b>
</div>

which he than styles with rules that (stripped down to the bits I want
to question) look like...

#links a {
display: block;
}
#links b {
display: none;
}

which puts the links on separate lines and hides the | character. This
has the side-effect that older browsers will show the links in one line
(browser width permitting) with a | between them.

My question is as to the wisdom of this approach. I thought that <b> was
not a good tag to use as it is presentational, and the idea was to get
the HTML free of any presentation. I know he hides them, but would it
not have been better to do something like...

<span id="linkseparator">|</span>

instead, as that does not have any semantic meaning. It could have been
hidden with a very similar rule.

Any comments? Have I missed something here? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
  #2  
Old March 16th, 2006, 04:25 PM
Spartanicus
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Alan Silver <alan-silver@nospam.thanx.invalid> wrote:
[color=blue]
>In a couple of projects (one in each book), EM has HTML
>like this (air code, so it's not exactly what he had)...
>
><div id="links">
><a href="fred.html">Fred</a><b>|</b>
><a href="john.html">John</a><b>|</b>
><a href="jim.html">Jim</a><b>|</b>
></div>[/color]

Eric Meyer is renowned for his poor HTML, use an unordered list instead
with a border.
[color=blue]
>My question is as to the wisdom of this approach. I thought that <b> was
>not a good tag to use as it is presentational, and the idea was to get
>the HTML free of any presentation.[/color]

<b> is a non semantic element.
[color=blue]
>I know he hides them, but would it
>not have been better to do something like...
>
><span id="linkseparator">|</span>[/color]

<span> is also non semantic, there is no advantage in using one over the
other, other than that elements like <b> and <i> are shorter.

--
Spartanicus
  #3  
Old March 16th, 2006, 04:35 PM
Els
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Spartanicus wrote:
[color=blue]
> <b> is a non semantic element.[/color]
[color=blue]
> <span> is also non semantic, there is no advantage in using one over the
> other, other than that elements like <b> and <i> are shorter.[/color]

And that <b> and <i> already have a default style, so there often is
no need to add a class and/or a stylerule in the stylesheet.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
  #4  
Old March 16th, 2006, 04:45 PM
dingbat@codesmiths.com
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Alan Silver wrote:
[color=blue]
> I thought that <b> was
> not a good tag to use as it is presentational, and the idea was to get
> the HTML free of any presentation.[/color]

No, the real idea is to avoid stuff that is _purely_ presentational.
<b>, <i>, <em> have sufficient precedent and implied historical use to
them that they can be argued to have as much semantic merit as anything
else in HTML. At least for _some_ uses, i.e. enough to justify the
existence of the tag (HTML can't really control the usage and
mis-usage of worthwhile tags used in worthless combinations).

Is <span class="emboldened" >foo</span> really better than <b>foo</b> ?


<font> is bad because it's a purely generalist element and makes no
implications of its own. Absolutely none. <font> never means (and can
never mean) anything (barring psychotic CSS that is just a "<font>
detector" and no more). <font> only starts to have any meaning when
it's used as <font size="..." > or <font class="..." > or similar, not
just <font>.

<u> is rather shakier. Printers rarely underlined and the development
of underlining is largely an artefact of typewriters where it was all
you had. Any good book on typography will point out that you should
avoid it almost totally, especially in body text, because it has poor
readability. So by this logic, <u> is heading back to being _purely_
presentational and best lost. It's preserved because it has
historically been a group with <b> and <i>, rather than with <font>

  #5  
Old March 16th, 2006, 04:55 PM
Alan Silver
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

In article
<1e3j121epbk65q0ssc5uru6ltpuecg5674@news.spartanic us.utvinternet.ie>,
Spartanicus <invalid@invalid.invalid> writes[color=blue]
>Alan Silver <alan-silver@nospam.thanx.invalid> wrote:
>[color=green]
>>In a couple of projects (one in each book), EM has HTML[/color][/color]
<snip>[color=blue]
>Eric Meyer is renowned for his poor HTML,[/color]

Oh, that puts rather a different light on his books!!
[color=blue]
> use an unordered list instead
>with a border.[/color]

Now you mention it, I seem to remember reading a few comments suggesting
that was a better way to mark up links. Thanks.
[color=blue][color=green]
>>My question is as to the wisdom of this approach. I thought that <b> was
>>not a good tag to use as it is presentational, and the idea was to get
>>the HTML free of any presentation.[/color]
>
><b> is a non semantic element.[/color]

Aren't "presentational" and "non semantic" the same thing? What I mean
is that both imply that the mark-up in question is not there for the
purposes of giving meaning to the content.
[color=blue][color=green]
>>I know he hides them, but would it
>>not have been better to do something like...
>>
>><span id="linkseparator">|</span>[/color]
>
><span> is also non semantic, there is no advantage in using one over the
>other, other than that elements like <b> and <i> are shorter.[/color]

But <b> and <i> are deprecated aren't they? Presumably they would be a
bad choice if you were to move towards a strict doctype. Please excuse
me if I'm talking rubbish here, but I thought that these tags were to be
avoided.

Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
  #6  
Old March 16th, 2006, 05:15 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

dingbat@codesmiths.com wrote:[color=blue]
> Alan Silver wrote:
>
>[color=green]
>>I thought that <b> was
>>not a good tag to use as it is presentational, and the idea was to get
>>the HTML free of any presentation.[/color]
>
> No, the real idea is to avoid stuff that is _purely_ presentational.
> <b>, <i>, <em> have sufficient precedent and implied historical use to
> them that they can be argued to have as much semantic merit as anything
> else in HTML.[/color]

That you're throwing <em> in with <b> and <i> shows that you're missing
part of the story. The <em> and <strong> tags *are* semantic and no one
suggests that they be avoided. It's <b> and <i> that are purely, or
almost purely, presentational, and a large part of the time <strong> and
<em>, respectively, should actually be used *instead*.

Then there are times when, say, italics would be used to make a
particular component of an article stand out. For example, a newsletter
might print an editor's note in italics to help differentiate it from
the article containing it: [_Editor's note: ...]_. For this purpose, a
class named, say, "editorsNote", should be assigned to the notes using a
<span> or <div>, or by applying the class to a tag that may already
surround the text in question, like a <p>. Then .editorsNote should be
styled italic.
  #7  
Old March 16th, 2006, 05:15 PM
Spartanicus
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Alan Silver <alan-silver@nospam.thanx.invalid> wrote:
[color=blue][color=green]
>><b> is a non semantic element.[/color]
>
>Aren't "presentational" and "non semantic" the same thing?[/color]

Usually.
[color=blue]
>What I mean
>is that both imply that the mark-up in question is not there for the
>purposes of giving meaning to the content.[/color]

Usage of markup such as div and span is required to achieve certain
stylistic effects. There's no intrinsic harm in that provided that the
elements that are used are not semantic, and used minimally.
[color=blue][color=green]
>><span> is also non semantic, there is no advantage in using one over the
>>other, other than that elements like <b> and <i> are shorter.[/color]
>
>But <b> and <i> are deprecated aren't they?[/color]

They are valid under HTML 4 Strict and it's reformulation in XML.
[color=blue]
>Presumably they would be a
>bad choice if you were to move towards a strict doctype.[/color]

Transitional doctypes should only be used for legacy documents when the
rest of the code cannot be updated.

--
Spartanicus
  #8  
Old March 16th, 2006, 06:05 PM
Alan Silver
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Thanks for the clarification

In article
<946j12pr2e44kafe0df3c09o8b3hhk34c7@news.spartanic us.utvinternet.ie>,
Spartanicus <invalid@invalid.invalid> writes[color=blue]
>Alan Silver <alan-silver@nospam.thanx.invalid> wrote:
>[color=green][color=darkred]
>>><b> is a non semantic element.[/color]
>>
>>Aren't "presentational" and "non semantic" the same thing?[/color]
>
>Usually.
>[color=green]
>>What I mean
>>is that both imply that the mark-up in question is not there for the
>>purposes of giving meaning to the content.[/color]
>
>Usage of markup such as div and span is required to achieve certain
>stylistic effects. There's no intrinsic harm in that provided that the
>elements that are used are not semantic, and used minimally.
>[color=green][color=darkred]
>>><span> is also non semantic, there is no advantage in using one over the
>>>other, other than that elements like <b> and <i> are shorter.[/color]
>>
>>But <b> and <i> are deprecated aren't they?[/color]
>
>They are valid under HTML 4 Strict and it's reformulation in XML.
>[color=green]
>>Presumably they would be a
>>bad choice if you were to move towards a strict doctype.[/color]
>
>Transitional doctypes should only be used for legacy documents when the
>rest of the code cannot be updated.
>[/color]

--
Alan Silver
(anything added below this line is nothing to do with me)
  #9  
Old March 16th, 2006, 08:05 PM
Alan J. Flavell
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

On Thu, 16 Mar 2006, Harlan Messinger wrote:
[color=blue]
> That you're throwing <em> in with <b> and <i> shows that you're missing part
> of the story. The <em> and <strong> tags *are* semantic and no one suggests
> that they be avoided.[/color]

....right...
[color=blue]
> It's <b> and <i> that are purely, or almost purely,
> presentational,[/color]

....right...
[color=blue]
> and a large part of the time <strong> and <em>, respectively,
> should actually be used *instead*.[/color]
^^^^^^?

Then <i> or <b> were being seriously MISused - because if there's one
thing that <i> or <b> can NOT mean, when properly used, it is emphasis
(otherwise the author would have USED the appropriate emphasis
markup).

And the same goes for <cite>, or <var> ...

So, if <i> and <b> are properly used, they necessarily mean something
for which there exists no proper structural markup in HTML. But for
which the use of a particular rendering is so universally agreed as to
support the use of <i> or <b> markup, as opposed to merely <span> with
an associated stylesheet proposal. For example, genus or species
name, in scientific usage.
  #10  
Old March 16th, 2006, 08:15 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: Eric Meyer uses <b> - isn't there a better way?

Alan J. Flavell wrote:[color=blue]
> On Thu, 16 Mar 2006, Harlan Messinger wrote:
>
>[color=green]
>>That you're throwing <em> in with <b> and <i> shows that you're missing part
>>of the story. The <em> and <strong> tags *are* semantic and no one suggests
>>that they be avoided.[/color]
>
>
> ...right...
>
>[color=green]
>>It's <b> and <i> that are purely, or almost purely,
>>presentational,[/color]
>
>
> ...right...
>
>[color=green]
>>and a large part of the time <strong> and <em>, respectively,
>>should actually be used *instead*.[/color]
>
> ^^^^^^?
>
> Then <i> or <b> were being seriously MISused - because if there's one
> thing that <i> or <b> can NOT mean, when properly used, it is emphasis
> (otherwise the author would have USED the appropriate emphasis
> markup).[/color]

Right, that was the point: they *are* being misused, in places where
<strong> and <em> ought to be used instead.
[color=blue]
>
> And the same goes for <cite>, or <var> ...[/color]

True. <cite> possibly also a large part of the time; <var> not so large
part of the time because only a small portion of the instances of
boldfacing going on on the Web is to denote variables.
[color=blue]
>
> So, if <i> and <b> are properly used, they necessarily mean something
> for which there exists no proper structural markup in HTML. But for
> which the use of a particular rendering is so universally agreed as to
> support the use of <i> or <b> markup, as opposed to merely <span> with
> an associated stylesheet proposal. For example, genus or species
> name, in scientific usage.[/color]
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles