CSS tags difference?

S

Steve H

Hello again,

What's the difference between using the following two
formatting options:

<p><SPAN><b>This section</b></SPAN> is to be bold.</p>

<p><b>This section</b> is to be bold.</p>

(The <p> is defined through an exernal CSS style sheet.) Is
there an advantage of one formatting over the other? The
reason I ask is that I want to make sure I incorporate the
format used by most future browsers.

Thanks!
Steve H
 
C

clintonG

K

Kevin Spencer

Both formats are supported by all browsers. However, using CSS separates the
layout formatting from the content.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
J

Jon Spivey

Hi,
The second would be better. You can redifine <b> in your stylesheet to show
whatever you want - bold/colour/font etc. There's no need to get span tags
in there
 
S

Steve H

Thanks for all your help! I'll look up the URLs, too. I
read a lot about CSS, but was uncertain about the question
I posed. Tags seemed redundant to me.

Steve H
 
M

Murray

I'm not sure what the <span> tag is there for. But either method will work
in any browser for the forseeable future.

The difference, however, would be in using <b>, as opposed to <strong>. The
latter has syntactical significance (especially to a screen reader) while
the latter has none.
 
S

Steve H

Thanks! I am currently replacing all <strong> tags with <b>
tags.

When I was checking out my earliest web pages done by MS
FP98, I noticed FP98 put <DIV> tags around <center> tags.
Is this because the designers knew the <center> tags would
be deprecated in time? If so, good job, Microsoft!
 
C

Chris Leeds, MVP-FrontPage

inline;

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
--
Steve H said:
Thanks! I am currently replacing all <strong> tags with <b>
tags.

that's kind of the reverse of the current trend. there are advantages of
css markup that you can have and forward looking potential that will be
available so you might want to re-think this.
When I was checking out my earliest web pages done by MS
FP98, I noticed FP98 put <DIV> tags around <center> tags.
Is this because the designers knew the <center> tags would
be deprecated in time? If so, good job, Microsoft!

perhaps it was a bit of code used to center something like a table in a
page?
 
S

Steve H

Thanks! I am currently replacing all said:
that's kind of the reverse of the current trend. there are advantages of
css markup that you can have and forward looking potential that will be
available so you might want to re-think this.


Well, the <p> text is identified in the CSS external style
sheet. The <b> portion within the <p> tags will still
change if I change the <p> font type alone. Am I thinking
wrong here? If I change the font from Times to Arial, the
<b> tags will give me bold Arial.
 
M

Murray

That's correct.

But the point is this. <b> is usually used to indicate something important.
But if someone using an assistive device (like a screen reader) is visiting
your pages, you would like to make that important content somehow stand out
in the aural rendition of your page. Thus the current trend is to replace
<b> with <strong>, since the latter tag has a "semantic" meaning, and can be
rendered in a different voice by screenreaders. With the <b> tag alone,
there is no such semantic meaning.

Why is it you want to make this replacement?
 
S

Steve H

I was making the <b> replacement with the assumption that
it was more current than <strong>. I didn't know the change
would influence assistive listening devices. It'll be easy
to do a global Replace to change all <b></b> tags to
 
M

Murray

You're welcome!

--
Murray

Steve H said:
I was making the <b> replacement with the assumption that
it was more current than <strong>. I didn't know the change
would influence assistive listening devices. It'll be easy
to do a global Replace to change all <b></b> tags to
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top