HighDots Forums  

Eric Meyer uses <b> - isn't there a better way?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Eric Meyer uses <b> - isn't there a better way? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alan Silver
 
Posts: n/a

Default Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 09:39 AM






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)

Reply With Quote
  #2  
Old   
Spartanicus
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 10:13 AM






Alan Silver <alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

Quote:
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
Eric Meyer is renowned for his poor HTML, use an unordered list instead
with a border.

Quote:
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.
<b> is a non semantic element.

Quote:
I know he hides them, but would it
not have been better to do something like...

span id="linkseparator">|</span
<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


Reply With Quote
  #3  
Old   
Els
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 10:15 AM



Spartanicus wrote:

Quote:
b> is a non semantic element.

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.
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/


Reply With Quote
  #4  
Old   
dingbat@codesmiths.com
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 10:34 AM



Alan Silver wrote:

Quote:
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.
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>



Reply With Quote
  #5  
Old   
Alan Silver
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 10:37 AM



In article
<1e3j121epbk65q0ssc5uru6ltpuecg5674 (AT) news (DOT) spartanicus.utvinternet.ie>,
Spartanicus <invalid (AT) invalid (DOT) invalid> writes
Quote:
Alan Silver <alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

In a couple of projects (one in each book), EM has HTML
snip
Eric Meyer is renowned for his poor HTML,
Oh, that puts rather a different light on his books!!

Quote:
use an unordered list instead
with a border.
Now you mention it, I seem to remember reading a few comments suggesting
that was a better way to mark up links. Thanks.

Quote:
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.

b> is a non semantic element.
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.

Quote:
I know he hides them, but would it
not have been better to do something like...

span id="linkseparator">|</span

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.
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)


Reply With Quote
  #6  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 11:03 AM



dingbat (AT) codesmiths (DOT) com wrote:
Quote:
Alan Silver wrote:


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.

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.
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.


Reply With Quote
  #7  
Old   
Spartanicus
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 11:04 AM



Alan Silver <alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

Quote:
b> is a non semantic element.

Aren't "presentational" and "non semantic" the same thing?
Usually.

Quote:
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.
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.

Quote:
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.

But <b> and <i> are deprecated aren't they?
They are valid under HTML 4 Strict and it's reformulation in XML.

Quote:
Presumably they would be a
bad choice if you were to move towards a strict doctype.
Transitional doctypes should only be used for legacy documents when the
rest of the code cannot be updated.

--
Spartanicus


Reply With Quote
  #8  
Old   
Alan Silver
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 11:52 AM



Thanks for the clarification

In article
<946j12pr2e44kafe0df3c09o8b3hhk34c7 (AT) news (DOT) spartanicus.utvinternet.ie>,
Spartanicus <invalid (AT) invalid (DOT) invalid> writes
Quote:
Alan Silver <alan-silver (AT) nospam (DOT) thanx.invalid> wrote:

b> is a non semantic element.

Aren't "presentational" and "non semantic" the same thing?

Usually.

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.

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.

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.

But <b> and <i> are deprecated aren't they?

They are valid under HTML 4 Strict and it's reformulation in XML.

Presumably they would be a
bad choice if you were to move towards a strict doctype.

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

--
Alan Silver
(anything added below this line is nothing to do with me)


Reply With Quote
  #9  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 01:52 PM



On Thu, 16 Mar 2006, Harlan Messinger wrote:

Quote:
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.
....right...

Quote:
It's <b> and <i> that are purely, or almost purely,
presentational,
....right...

Quote:
and a large part of the time <strong> and <em>, respectively,
should actually be used *instead*.
^^^^^^?

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.


Reply With Quote
  #10  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Eric Meyer uses <b> - isn't there a better way? - 03-16-2006 , 02:00 PM



Alan J. Flavell wrote:
Quote:
On Thu, 16 Mar 2006, Harlan Messinger wrote:


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.


...right...


It's <b> and <i> that are purely, or almost purely,
presentational,


...right...


and a large part of the time <strong> and <em>, respectively,
should actually be used *instead*.

^^^^^^?

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).
Right, that was the point: they *are* being misused, in places where
<strong> and <em> ought to be used instead.

Quote:
And the same goes for <cite>, or <var> ...
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.

Quote:
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.

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.