|
Posted by Dan on August 27, 2004, 9:34 am
Please log in for more thread options
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
|
|
Posted by jmm-list-gn on August 27, 2004, 12:33 pm
Please log in for more thread options
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)
|
|
Posted by Chris Morris on August 28, 2004, 4:17 pm
Please log in for more thread options > 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
|
|
Posted by Martin Honnen on August 27, 2004, 5:43 pm
Please log in for more thread options
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/
|
|
Posted by Henri Sivonen on August 27, 2004, 6:39 pm
Please log in for more thread options 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
hsivonen@iki.fi
http://iki.fi/hsivonen/ Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
|
| Similar Threads | Posted | | Firefox - Prevent TextField size change when user changes font size? | October 3, 2006, 6:21 pm |
tag font and size | December 30, 2004, 12:05 pm |
| Best way to specify font size | December 11, 2005, 6:45 pm |
| Font-size buttons | October 6, 2005, 9:42 am |
| Behind-the-scenes font size changes | October 11, 2006, 6:01 am |
| MSIE font size change? | April 8, 2005, 10:22 pm |
| Question of font size change | May 5, 2005, 10:08 pm |
| font-size-bigger-smaller? | September 19, 2005, 9:04 pm |
| Allow the user to increase font size | December 2, 2005, 6:43 pm |
| XHTML & CSS Font-Size Oddity.. | May 18, 2007, 4:23 pm |
|