松散的DTD和字体大小 [英] Loose DTD and font size

查看:70
本文介绍了松散的DTD和字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我刚刚开始使用这个DTD语句(由Dreamweaver MX自动插入

2004):

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"

" http://www.w3.org/TR/html4/loose.dtd" >


突然,我页面上的字体大小减少了一个级别(例如,从

小到x小)。我通过在.css中增加它们来测试它,然后它们再次看起来好了。


我的样式表定义:

< link rel =" stylesheet" HREF ="&的main.css QUOT; type =" text / css">


样式表中的相关行:

body,input,td {

font-family:Tahoma;

font-size:x-small;

}


为什么字体大小会改变?我不认为这将由DTD声明控制

.


如果预期字体改变,那么关于我如何的任何建议

是否包含没有DTD语句的旧页面,以及有DTD语句的新页面?b $ b页面?其中一个挑战是:他们都分享了相同的CSS文件。


谢谢!


-dan < br>

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

推荐答案

文章< 7P ******************** @ comcast.com> ,丹 < bo *** @ foo.bar>

写道:
In article <7P********************@comcast.com>, "Dan" <bo***@foo.bar>
wrote:
我刚开始使用这个DTD语句(由Dreamweaver MX自动插入
2004):
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"
" http://www.w3.org/TR/html4/ loose.dtd">

突然,我页面上的字体大小减少了一个级别
为什么字体大小会改变?我不认为这会受到DTD声明的控制。


旧的行为(将小而不是中等映射到用户pref)是一个

的怪癖。请参阅 http://iki.fi/hsivonen/doctype

如果预期字体更改,那么有关我如何能够容纳没有DTD语句的旧页面以及具有DTD语句的新页面的任何建议?其中一个挑战是:它们都共享相同的CSS文件。
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.




使用百分比或ems而不是关键字。


-

Henri Sivonen
hs ****** @ iki。 fi
http://iki.fi/hsivonen/

Mozilla Web Author FAQ: http:/ /mozilla.org/docs/web-developer/faq.html



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





Dan写道:



Dan wrote:

我刚开始使用这个DTD语句(由Dreamweaver MX自动插入2004年):
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN"
" http://www.w3.org/TR/html4/loose.dtd">

突然,字体大小在我的页面上减少了一个级别(例如,从小型到小型)。我通过在.css中增加它们来测试它,并且它们再次看起来很好。

我的样式表定义:
< link rel =" stylesheet" HREF ="&的main.css QUOT; type =" text / css">

样式表中的相关行:
body,input,td {
font-family:Tahoma;
font-size:x-small;
}

为什么字体大小会改变?我不认为这会受到DTD声明的控制。

如果预期字体改变,那么任何有关我如何能够容纳两个遗留页面的建议没有DTD声明,以及有DTD声明的新
页面?其中一个挑战是:它们共享相同的CSS文件。
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.




现代浏览器,如IE 5 / Mac,IE 6 / Win,Netscape 7,Mozilla ,Opera 7

决定是否存在某个DOCTYPE声明节点是否以
渲染页面的怪异模式或符合标准(严格)模式。在

怪癖模式中,浏览器错误/古怪的浏览器如Netscape 4或IE

4被模拟,其中一个怪癖是CSS规则应该适用

到< td>例如,元素不作为继承规则应用
由CSS 1/2规范指定的
被忽略。

因此,您遇到的差异肯定是由

浏览器现在以符合标准的模式呈现您的页面,并且您需要获得符合CSS 1/2的渲染,而您的旧页面是以
呈现的与CSS 1/2建议相比,古怪/越野车的方式。


-


Martin Honnen
http://JavaScript.FAQTs.com/


2004年8月27日星期五,Dan写道:
On Fri, 27 Aug 2004, Dan wrote:
body,input,td {
font-size:x-small;

如果字体更改是预期的,然后任何建议我如何可以容纳没有DTD语句的旧页面,以及有DTD语句的新页面?
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?




删除th e * idiotic *" font-size:x-small"并且没有指定字体大小!


-

热门发布。

什么是最烦人的事情在Usenet上?



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

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


这篇关于松散的DTD和字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆