By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,983 Members | 1,582 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,983 IT Pros & Developers. It's quick & easy.

Loose DTD and font size

P: n/a
Dan
Hi,

I just started using this DTD statement (auto-inserted by Dreamweaver MX
2004):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Suddenly, the font sizes on my pages decreased by one level (e.g., from
small to x-small). I tested this by increasing them in the .css, and they
looked OK again.

My style sheet definition:
<link rel="stylesheet" href="main.css" type="text/css">

And the relevant lines in the stylesheet:
body, input,td {
font-family : Tahoma;
font-size : x-small;
}

Why would font size change? I wouldn't think this would be controlled by
the DTD statement.

If the font change is expected, then any suggestions on how I might
accomodate both legacy pages that don't have the DTD statement, and new
pages that do have the DTD statement? One of the challenges: they all share
the same CSS file.

Thanks!

-dan
Jul 23 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
In article <7P********************@comcast.com>, "Dan" <bo***@foo.bar>
wrote:
I just started using this DTD statement (auto-inserted by Dreamweaver MX
2004):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Suddenly, the font sizes on my pages decreased by one level Why would font size change? I wouldn't think this would be controlled by
the DTD statement.
The old behavior (mapping small instead of medium to the user pref) is a
quirk. See http://iki.fi/hsivonen/doctype
If the font change is expected, then any suggestions on how I might
accomodate both legacy pages that don't have the DTD statement, and new
pages that do have the DTD statement? One of the challenges: they all share
the same CSS file.


Use percentages or ems instead of the keywords.

--
Henri Sivonen
hs******@iki.fi
http://iki.fi/hsivonen/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
Jul 23 '05 #2

P: n/a


Dan wrote:

I just started using this DTD statement (auto-inserted by Dreamweaver MX
2004):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Suddenly, the font sizes on my pages decreased by one level (e.g., from
small to x-small). I tested this by increasing them in the .css, and they
looked OK again.

My style sheet definition:
<link rel="stylesheet" href="main.css" type="text/css">

And the relevant lines in the stylesheet:
body, input,td {
font-family : Tahoma;
font-size : x-small;
}

Why would font size change? I wouldn't think this would be controlled by
the DTD statement.

If the font change is expected, then any suggestions on how I might
accomodate both legacy pages that don't have the DTD statement, and new
pages that do have the DTD statement? One of the challenges: they all share
the same CSS file.


Modern browsers like IE 5/Mac, IE 6/Win, Netscape 7, Mozilla, Opera 7
decide on the presence of a certain DOCTYPE declaration node whether to
render the page in quirks mode or standards compliant (strict) mode. In
quirks mode browser bugs/quirks of older browsers like Netscape 4 or IE
4 are emulated, one of those quirks is that CSS rules that should apply
to <td> elements for instance are not applied as inheritance rules
specified by the CSS 1/2 specifications are ignored.
So the differences you experience are most certainly caused by the
browsers now rendering your pages in standards compliant mode and you
get the rendering that is CSS 1/2 compliant while your older pages are
rendered in a quirky/buggy way compared to what CSS 1/2 suggest.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3

P: n/a
On Fri, 27 Aug 2004, Dan wrote:
body, input,td {
font-size : x-small;

If the font change is expected, then any suggestions on how I might
accomodate both legacy pages that don't have the DTD statement, and new
pages that do have the DTD statement?


Remove the *idiotic* "font-size : x-small" and do not specify a font size!

--
Top-posting.
What's the most irritating thing on Usenet?

Jul 23 '05 #4

P: n/a
Quoth the raven Andreas Prilop:
On Fri, 27 Aug 2004, Dan wrote:
body, input,td { font-size : x-small;

If the font change is expected, then any suggestions on how I
might accomodate both legacy pages that don't have the DTD
statement, and new pages that do have the DTD statement?


Remove the *idiotic* "font-size : x-small" and do not specify a
font size!


Correct me if I am wrong, but I believe I remember reading that (some
versions of) IE screw up if nothing is specified, and that it is wise
to use:

font-size: 100%;

...to overcome this bug.

--
-bts
-This space intentionally left blank.
Jul 23 '05 #5

P: n/a
Beauregard T. Shagnasty <a.*********@example.invalid> wrote:
Correct me if I am wrong, but I believe I remember reading that (some
versions of) IE screw up if nothing is specified, and that it is wise
to use:

font-size: 100%;

..to overcome this bug.


That's a workaround for MSIE/Win's buggy implementation of em units.
Without

body { font-size: 100% }

in the style sheet, em units are scaled much too large/small when the user
selects anything other than View > Text Size > Medium.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"If you aren't part of the solution, then you are part of the precipitate."
Jul 23 '05 #6

P: n/a
Dan wrote:

I just started using this DTD statement (auto-inserted by Dreamweaver MX
2004):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Suddenly, the font sizes on my pages decreased by one level (e.g., from
small to x-small). I tested this by increasing them in the .css, and they
looked OK again.

And the relevant lines in the stylesheet:
body, input,td {
font-family : Tahoma;
font-size : x-small;
} The font size became x-small because that is what you specified. Others
have explained why the relative size changed.
It is considered bad practice to specify a font size at all, especially
one as small as x-small. You visitors all must have very low resolution
monitor settings, or magnifying glasses.
Another oversight is the lack of a default font-family. Obviously your
target market is Windows users only, and only those of win2k and later.
Not all Windows installations have Tahoma.
If the font change is expected, then any suggestions on how I might
accomodate both legacy pages that don't have the DTD statement, and new
pages that do have the DTD statement? One of the challenges: they all share
the same CSS file.

Edit all the older pages to include the DTD spec. There is nothing you
can do in CSS to hack around the problem of a missing DTD.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 23 '05 #7

P: n/a
Andreas Prilop wrote:
Remove the *idiotic* "font-size : x-small" and do not specify a font size!


There is absolutely nothing wrong with specifying a font size. If it's
too small for you, increase it, That's why your UA gives you the
option. Having said that, though, it is important that authors do not
specify font sizes that are too small for the main content (I would not
specify anything smaller than font-size: small; but usually medium is
fine) But for other sections, such as the footer, or minor stuff in a
side bar, or whatever, it's ok, and sometimes useful to make it smaller.
So your comment is not helpful at all.

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 23 '05 #8

P: n/a
On Sat, 28 Aug 2004 05:43:39 GMT, Lachlan Hunt
<la**********@lachy.id.au.invalid> wrote:
Andreas Prilop wrote:
Remove the *idiotic* "font-size : x-small" and do not specify a font
size!
There is absolutely nothing wrong with specifying a font size. If it's
too small for you, increase it, That's why your UA gives you the
option.


I'd rather the user not have to adjust the font size themselves. Some
sites succeed with small fonts, largely because their content is in
demand. Is yours? Is the OP's?
Having said that, though, it is important that authors do not specify
font sizes that are too small for the main content (I would not specify
anything smaller than font-size: small; but usually medium is fine)
We differ, but only in that "small" is (at least in Standards mode) not as
large as the preset text of the viewer.
But for other sections, such as the footer, or minor stuff in a side
bar, or whatever, it's ok, and sometimes useful to make it smaller. So
your comment is not helpful at all.


Hmm.

While I agree that setting non-default font sizes is often a fine thing to
do, I believe that it's appropriate to set the general body text of a
document at 100%. Not small, not 80%, not 14pt. Of course, pt and px
should never be used for other reasons. Ems have their problems in IE. But
%'s less than 100 and keywords smaller than medium (again, assuming
Standards mode) result in text which is smaller than the user may prefer.
It certainly isn't going to be too big for the user to read. But it could
very well be too small.

Using microfonts (anything under "small" or about 80%) is going to risk
being unreadable by a portion of your visitors. If your website is so
great that it's worth messing with your browser's settings to access,
lucky you. The rest of us, we need the content to be as clear al possible
so we hold our visitors.

My opinion is simple. 100% is regular body text, and all design is based
on that fact. Smaller's ok for any text which is not required for use of
the site.
Jul 23 '05 #9

P: n/a
Lachlan Hunt wrote:
Andreas Prilop wrote:
Remove the *idiotic* "font-size : x-small" and do not specify a font
size!
There is absolutely nothing wrong with specifying a font size.


For the body element, yes there is, unless it happens to be 100% (usually
made explicit as a browser bug workaround).
If it's too small for you, increase it, That's why your UA gives you the
option.


I already did. If I increase it more, sites with properly designed CSS now
have a font size way too large for my tastes.

I set my font size so I get that size as my running text, not so it can get
knocked down 4 or more points by idiotic CSS.

--
Shawn K. Quinn
Jul 23 '05 #10

P: n/a
jmm-list-gn <jm***************@sohnen-moe.com> writes:
Dan wrote:
body, input,td {
font-family : Tahoma;
font-size : x-small;
}


Another oversight is the lack of a default font-family. Obviously
your target market is Windows users only, and only those of win2k and
later. Not all Windows installations have Tahoma.


Alternatively, it may be a case of "if Tahoma isn't available, the
font doesn't matter" even to the extent of whether the browser default
is serif or sans-serif.

--
Chris
Jul 23 '05 #11

P: n/a
Lachlan Hunt wrote:
Andreas Prilop wrote:
Remove the *idiotic* "font-size : x-small" and do not specify a
font size!


There is absolutely nothing wrong with specifying a font size.


This is already being discussed in another thread. Must we open the can
of worms here, too?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #12

P: n/a
On Sat, 28 Aug 2004, Lachlan Hunt wrote:
Remove the *idiotic* "font-size : x-small" and do not specify a font size!


There is absolutely nothing wrong with specifying a font size.


| body { font-size : x-small }

*is* idiotic.

Jul 23 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.