it appears that <ttwill not do <b>
although it will do <u>.
>
IS there any way to do bold with a fixed width?
I have found that one can make bold text with <tt>, but that for Courier
New the difference in darkness can be quite small, hence it might look
like the text is not bold when it actually is. One approach I tried was
to use CSS to make the preferred font Dark Courier when <tttext is
bold, and this helps a little, but of course many people will not have
the Dark Courier font.
On Sat, 18 Oct 2008 16:12:54 -0400 in
gddg07$nu3$1@re gistered.motzar ella.org, RickMerrill
<Rick0.merrill@ gmail.NOSPAM.co mwrote:
>
>it appears that <ttwill not do <b>
>although it will do <u>.
>>
>IS there any way to do bold with a fixed width?
>
Via a stylesheet?
>
tt {font-weight: bold} seems to work OK to me. If however you want fixed width you may
have to add in a font-family:monospac e too.
>
Stephan
I'll try the font-family. What I should have said I want
is to turn bold on and off within a <ttstream.
On Sat, 18 Oct 2008 16:39:02 -0400 in
gddhh8$ok$1@reg istered.motzare lla.org, RickMerrill
<Rick0.merrill@ gmail.NOSPAM.co mwrote:
Stephan Bird wrote:
>On Sat, 18 Oct 2008 16:12:54 -0400 in
>gddg07$nu3$1@r egistered.motza rella.org, RickMerrill
><Rick0.merrill @gmail.NOSPAM.c omwrote:
>>
>>it appears that <ttwill not do <b>
>>although it will do <u>.
>>>
>>IS there any way to do bold with a fixed width?
>>
>Via a stylesheet?
>>
>tt {font-weight: bold} seems to work OK to me. If however you want
>fixed width you may have to add in a font-family:monospac e too.
>>
>Stephan
>
I'll try the font-family. What I should have said I want is to turn
bold on and off within a <ttstream.
How about
<tt>This text is not bold but <span style="font-weight:bold">th is text
is</span>.</tt>
On Sat, 18 Oct 2008 16:39:02 -0400 in
gddhh8$ok$1@reg istered.motzare lla.org, RickMerrill
<Rick0.merrill@ gmail.NOSPAM.co mwrote:
>
>Stephan Bird wrote:
>>On Sat, 18 Oct 2008 16:12:54 -0400 in
>>gddg07$nu3$1@ registered.motz arella.org, RickMerrill
>><Rick0.merril l@gmail.NOSPAM. comwrote:
>>>
>>>it appears that <ttwill not do <b>
>>>although it will do <u>.
>>>>
>>>IS there any way to do bold with a fixed width?
>>Via a stylesheet?
>>>
>>tt {font-weight: bold} seems to work OK to me. If however you want
>>fixed width you may have to add in a font-family:monospac e too.
>>>
>>Stephan
>I'll try the font-family. What I should have said I want is to turn
>bold on and off within a <ttstream.
>
How about
>
<tt>This text is not bold but <span style="font-weight:bold">th is text
is</span>.</tt>
>
then?
>
Stephan
>
The style solution worked fine with the font-family (true bold, not just
fattened letters) and I like using CSS.
it appears that <ttwill not do <b>
although it will do <u>.
>
IS there any way to do bold with a fixed width?
New documents should be created with a Strict Doctype and therein Font
Markups (TT | I | B | BIG | SMALL) are not deprecated, but discouraged
in favor of style sheets, whereas (U) is deprecated and CSS should be
used instead. Do not use those tags, use others and apply to them what
Stephan gave.
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.
Comment