text format question

liunx

Guest
I'm not exactly new to CSS. In fact, I love CSS and I use it where I can. But recently I came across something interesting. And I'm not sure how to handle this one.

say I have a sentance, and for some reason, need just one word underlined or in bold. If the latest standards say I shouldn't use <b></b> or <u> </u> tags, then how would I convert something like...
I <b><u>LOVE< /u></b> CSS ?.unnamed {
font-weight: bold;
text-decoration: underline;
}

HTML:

I <span class="unnamed">LOVE</span> CSS!



:) Good Luck!
ArgonYour page needs to make sense without style sheets or presentaton mark up. (<!-- m --><a class="postlink" href="http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-order-style-sheets">http://www.w3.org/TR/WCAG10/wai-pageaut ... yle-sheets</a><!-- m -->) If you are trying to indicate emphasis then use the EM element.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<style type="text/css">
<!--
em {font-style:normal; font-weight:bold; text-decoration:underline; text-transform:uppercase}
-->
</style>
<p>I <em>love</em> <acronym title="Cascading Style Sheets">CSS</acronym>.</p>Just as a question; I understand that both the <strong> and <em> elements have been left in the HTML4.01 specification, although they seem to accomplish the same task. Is this just to give you more control over presentation, or is their another reason that you know of?Originally posted by cijori
Is this just to give you more control over presentation, or is their another reason that you know of? HTML should never be used to control presentation but to describe the meaning of the content. EM means emphasis and STRONG means strong emphasis. See <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/struct/text.html#h-9.2.1.Originally">http://www.w3.org/TR/html4/struct/text. ... Originally</a><!-- m --> posted by Charles
HTML should never be used to control presentation but to describe the meaning of the content.

You misunderstand - I meant only that you could set seperate style sheet rules for the two of them. Thankyou for explaining their different meanings though.Originally posted by cijori
You misunderstand - I meant only that you could set seperate style sheet rules for the two of them.
If you do not use CSS, <b> and <strong> will display same for a visual browser. However, the former just styles the text visually (and has no meaning semantically), while the latter implies strong emphasis (which HAS a semantic meaning).

Hence to make text bold, you should use <span style="font-weight: bold"> instead of <b>. However, to state the phrase empatically, you should use <strong>. You may choose to (visually) style <strong> anywhichway you prefer.ummm... noone was talking about using <b>. I was refering to <em> and <strong>.ummm... noone was talking about using <b>. I was refering to <em> and <strong>.
You may choose to (visually) style <strong> anywhichway you prefer.
:)
- Niketthanks for the replies.
So here's another question, which would be more appropriate to use?
<em style=text-decoration:underline;"></em>
or
<span style="text-decoration:underline;"></span>?

and just for the sake of arguement, what is the meaning of the span tag? Is it just me as it seems like the <div> tag, lots of people use it, but only hard core coders can tell you what it means and use it correctly.

As an aside, style can never make up for poor writing.Depends what you are doing. If you are trying to emphasise some text, em is better. If you are just doing 'cosmetic surgery' then span.
Div and span are for grouping features together. The only difference between them is that div is block level (square shaped, adds line breaks afterward), while span is inline (hugs the exact shape and size of it's contents.)Thanks. Now if I could only figure out why frontpage creates such bloated documents :DNow if I could only figure out why frontpage creates such bloated documents :D
Because its evil :)Originally posted by firegryphon3207
Thanks. Now if I could only figure out why frontpage creates such bloated documents :D

You should see what dreamweaver did in the hands of the less experienced users i've seen. :eek:I dread to think, I use dreamweaver MX for coding, but I've never actually done anyting in any other views using dreamweaver. But I have had more than my share of "fixing" sites that were started by small business owners who used front page because it came with their office software! :D
 
Back
Top