我想在现代浏览器中显示旧的HTML2。 (糟糕的)HTML3代码包含字体的 HTML元素,大小的属性。文本的大小以像素为单位定义,因此size =“14”表示用户希望文本的大小为14px。字体大小属性不是以像素为单位?
W3School文档指定size属性的有效值只能是“1,2,3,4,5,6,7,+ 1,+ 2,+ 3,+ 4,+ 5, + 6,+ 7,-1,-2,-3,-4,-5,-6,-7" 。所以看起来字体大小属性单位不是像素,而是em或什么的?
有没有办法让字体元素以像素为单位显示字体文本大小?
我曾尝试以下,但他们不以Safari浏览器工作:
<font size="14">test</font> // displays in huge text(its not 14px in font size)
<font size="14px">test</font> // looks the same as line 1
<font size="14pt">test</font> // looks the same as line 1
<font size="14em">test</font> // On Firefox the font size is 14px(correct) but on Safari it looks the same as line 1
<font size="14%">test</font> // looks the same as line 1
也许如果我试图改变HTML文件它会读取HTML3代码的DTD?
有没有理由不能使用样式属性? '' – Lee