473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Loose DTD and font size

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
12 4940
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


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
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
9
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
7
by: Daniel Kaplan | last post by:
I have the item below at the top of my style sheet. And it seems that the font-szie is ignored. I know that my linked style sheet is being read, and used because if I remove the font-family line,...
16
by: maya | last post by:
I have heard so much preaching here about how font sizes should be set as percentages so users can change font-sizes on their browsers... ok, so now at work am working on a site where we need to do...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
6
by: Miro | last post by:
Is there a way to / or a mathematical formula to see if a font size is 'too big' for a label. I have a label that is docked to 'fill' a form, and I want to resize that font based on the width...
2
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.