RickMerrill wrote:
What I should have said I want
is to turn bold on and off within a <ttstream.
What you should have said is the URL of your attempt.
Your initial description "it appears that <ttwill not do <balthough it
will do <u>" makes no sense. To begin with, tags don't do anything. They are
data. Data does not do anything, except in Star Treck.
What you probably meant to say is that you have a <tt>...</ttelement and
inside it you tried to use a <b>...</belement, and you expected - quite
reasonably - browsers to render the content of the latter in bold. If you
had posted a URL and specified the browser you used, we could have
immediately looked at the situation and would probably have observed that
the text _is_ in bold but is not well distinguishable from non-bold text (as
suggested in one reply in this thread).
The situation is relatively simple, so in _this_ case we can probably
reconstruct what happened. (But you would have got help faster and more
reliably if you had just posted the URL.) On IE 7 for example, factory
settings imply that for
<tt>foo <b>foo</b></tt>
the foo words look pretty much the same, although the latter is _slightly_
bolder. You can see this if you use the zooming function of the browser,
e.g. zooming with 200%.
This isn't really an HTML problem, and even though you could play with
presentational HTML markup to change font size or font face, that's really
clumsy and coarse. In HTML, you can select between 7 font sizes without even
knowing what they are (except via experimentation that tells you about some
assumed default behavior of those browsers that you care to test on).
But here's what I'd suggest for your style sheet:
tt { font-family: Consolas; font-size: 100%; }
The essential part is setting font-size to 100%, since by default most
browsers use reduced (about 90%) font size for <tt>. In 100% size, bolding
of monospace text tends to be visually more apparent. Setting font face to
Consolas just makes things prettier on computers that have this nice font
(which is especially suitable if you use other "Vista C fonts" like Cambria
or Calibri for copy text).
Note: If you intend to use <spanmarkup as some people have suggested,
check the usual CSS Caveats first. Using <spanis by definition meaningless
in HTML terms - it is semantically empty markup, whereas <bsays 'bold
face' and <strongsays 'strong emphasis'. If you want to bold e.g. keywords
in program source code, then I'd vote for <b>, since it's really not a
matter of emphasis but conventional presentation aimed at improving
readability.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/