Html IE中的字体看起来与Firefox和Chrome中的不同…为什么?

Html IE中的字体看起来与Firefox和Chrome中的不同…为什么?,html,fonts,cross-browser,font-size,Html,Fonts,Cross Browser,Font Size,我正在创建一个网站,IE中的字体看起来与Firefox和Chrome中的不同(它更大)。有人知道为什么吗?我如何在IE中修复它 这是我的密码: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <

我正在创建一个网站,IE中的字体看起来与Firefox和Chrome中的不同(它更大)。有人知道为什么吗?我如何在IE中修复它

这是我的密码:

  <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<head>
<img src="j0182695_downsized.jpg" alt="Oatmeal Raisin cookies" style="float: left" >

<title> Cameron Cookies </title>

</head>


<body background="back-225.gif">
<h1 style="text-align: center; color: red; font-family: Arial, Helvetica, sans-serif;">Cameron Cookies</h1>

<h2 style="font-style: italic; text-align: center;">The best homemade cookies in New England</h2>

<p style="text-align: center;">99 Sycamore St. Portland, ME 04101 (207) 555-1212</p>

<table width="500" border="0">
    <tr>
        <td align="center"><a href="about.htm">About Us</a></td>
        <td align="center"><a href="mailto:cookiemaster@cameroncookies.com">Contact Us</a></td>
        <td align="center"><a href="orderform.htm">Place an Order</a></td>
        <td align="center"><a href="recipe.htm">Sample Recipe</a></td>
    </tr>
</table>

<form name="Web Order Form" id="Web Order Form">
<!--this is the main table -->
<table border="0" width="65%" cellpadding="2">
<!--Personal Info. table -nested table 1 -->
    <tr>
        <th colspan="2" align="left">Personal Information</th>
    </tr>

    <tr> 
        <td style="width: 5px;"><label for="fname">First Name:</label></td> 
        <td><input name="fname" id="fname" size="30" type="text" /></td>
    </tr> 

    <tr>
        <td><label for="lname">Last Name:</label></td>
        <td><input name="lname" id="lname" size="30" type="text" /></td>
    </tr>

    <tr>
        <td><label for="address">Address:</label></td>
        <td><input name="address" id="address" size="30" type="text" /></td>
    </tr>

    <tr>
        <td><label for="city">City:</label></td>
        <td><input name="city" id="city" size="35" type="text" /></td>
    </tr>

    <tr>
        <td><label for="state">State:</label></td>
        <td><input name="state" id="state" size="3" type="text" /></td>
    </tr>

    <tr>
        <td><label for="zip">Zip Code:</label></td>
        <td><input name="zip" id="zip" size="10" type="text" /></td>
    </tr>

    <tr>
        <td><label for="country">Country:</label></td>
        <td><input name="country" id="country" size="10" type="text" /></td>
    </tr>

    <!--Order Info. table -nested table 2 -->
    <!--This is the first nested table within the main table -->
            <table border="2" width="65%" cellpadding="2">
            <!--Row 1 -->
                    <tr>
                        <th colspan="3" align="left">Order Information</th>
                    </tr>
            <!--Row 2 -->   
                    <tr>
                        <td width="5">QTY</td>
                        <td></td>
                        <td></td>
                        <td>Subtotal</td>
                        <td width="75%"><input name="Gift Wrapping" id="Gift Wrapping" type="checkbox" /> Gift wrapping? (Additional charge of 1.95 per box)</td>
                    </tr>
            <!-- Row 3 -->  
                    <tr>
                        <td><input name="quantitya" id="quantitya" size="3" type="textbox" value="0"/></td>
                        <td width="50%"></td>
                        <td width="50%" align="left"><label for="subtotala">Chocolate Nut - $10.99</label></td>
                        <td><input name="subtotala" id="subtotala" size="10" type="textbox" value="0"/></td>
                        <td >If yes, note the text for the gift card:</td>
                    </tr>
            <!-- Row 4 -->  
                    <tr>
                        <td><input name="quantityb" id="quantityb" size="3" type="textbox" value="0"/></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotalb">Chocolate Chip - $9.99</label></td>
                        <td><input name="subtotalb" id="subtotalb" size="10" type="textbox" value="0"/></td>
                        <td ><textarea wrap="soft" name="giftcardtext" id="giftcardtext" rows="3" cols="20" ></textarea></td> 
                    </tr>
            <!--Row 5 -->
                    <tr>
                        <td><input name="quantityc" id="quantityc" size="3" type="textbox" value="0"/></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotalc">Macadamia Nut - $12.99</label></td>
                        <td><input name="subtotalc" id="subtotalc" size="10" type="textbox" value="0"/></td> 
                    </tr>
            <!--Row 6 -->
                    <tr>
                        <td><input name="quantityd" id="quantityd" size="3" type="textbox" value="0"/></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotald">Oatmeal Raisin - $10.99</label></td>
                        <td><input name="subtotald" id="subtotald" size="10" type="textbox" value="0"/></td> 
                    </tr>
            <!--Row 7 -->
                    <tr>
                        <td><input name="quantitye" id="quantitye" size="3" type="textbox" value="0"/></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotale">Chocolate Dessert - $10.99</label></td>
                        <td><input name="subtotale" id="subtotale" size="10" type="textbox" value="0"/></td></td>
                        <td>Shipping:</td>
                        <td></td>
                        <td width="15000">$5.95 for 1-5 boxes, $10.95 for five or more boxes</td>
                    </tr>
            <!--Row 8 -->
                    <tr>
                        <td><input name="quantityf" id="quantityf" size="3" type="textbox" value="0"/></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotalf">Butter - $7.99</label></td>
                        <td><input name="subtotalf" id="subtotalf" size="10" type="textbox" value="0"/></td></td>
                        <td><label for="totala">Total:</label></td>
                        <td></td>
                        <td><input name="totala" id="totala" size="3" type="textbox" value="0.00" /></td>
                    </tr>
            <!--Row 9 -->
                    <tr>
                        <td></td>
                        <td width="15000"></td>
                        <td width="15000" align="left"><label for="subtotalg">Subtotal</label></td>
                        <td><input name="subtotalg" id="subtotalg" size="10" type="textbox" value="0" /></td></td>
                    </tr>
            </table>


<!--Payment Info. -nested table 3 -->
    <!--This is the second nested table within the main table -->
                    <table border="0" width="65%" cellpadding="2" cellspacing="5">
            <!--Row 1 -->
                            <tr>
                                <th align="left">Payment Information</th>
                            </tr>
            <!--Row 2 -->
                            <tr>
                                <td><input name="Mastercard button" id="Mastercard button" type="radio" />MasterCard</td>
                                <td><input name="Visa button" id="Visa button" type="radio" />Visa</td>
                            </tr>
            <!--Row 3 -->
                            <tr>
                                <td><label for="ccnum">Credit Card Number</label></td>
                                <td><input name="ccnum" id="ccnum" size="30" type="textbox" /></td>
                            </tr>
            <!--Row 4 -->
                            <tr>
                                <td>Expiration</td>
                                <td><select name="Month" id="Month">
                                        <option>January</option>
                                        <option>February</option>
                                        <option>March</option>
                                        <option>April</option>
                                        <option>May</option>
                                        <option>June</option>
                                        <option>July</option>
                                        <option>August</option>
                                        <option>September</option>
                                        <option>October</option>
                                        <option>November</option>
                                        <option>December</option>
                                    </select>
                                    <select name="year" id="year">
                                        <option>2002</option>
                                        <option>2003</option>
                                        <option>2004</option>
                                        <option>2005</option>
                                        <option>2006</option>
                                        <option>2007</option>
                                        <option>2008</option>
                                        <option>2009</option>
                                        <option>2010</option>
                                        <option>2011</option>
                                        <option>2012</option>
                                    </select>
                                </td>
                            </tr>
            <!--Row 5 -->
                            <tr>
                                <td><input name="submit button" id="submit button" type="submit" value="SUBMIT" /></td>
                            </tr>
                    </table>
</table>
</form> 

卡梅隆饼干
卡梅隆饼干
新英格兰最好的自制饼干
马萨诸塞州波特兰市桑树街99号04101(207)555-1212

个人信息 名字: 姓氏: 地址: 城市: 声明: 邮政编码: 国家: 订单信息 数量 小计 礼品包装?(每盒额外收费1.95元) 巧克力坚果-10.99美元 如果是,请注意礼品卡的文字: 巧克力片-9.99美元 澳洲坚果-12.99美元 燕麦葡萄干-10.99美元 巧克力甜点-10.99美元 航运: 1-5盒5.95美元,5盒或更多盒10.95美元 黄油-7.99美元 总数: 小计 付款信息 万事达卡 签证 信用卡号码 到期 一月 二月 前进 四月 也许 六月 七月 八月 九月 十月 十一月 十二月 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012

谢谢

定义字体大小样式:

<style type="text/css">
body{ font-size:medium; }
</style>

正文{字体大小:中等;}
您也可以尝试以像素为单位进行定义,以获得更高的一致性:

<style type="text/css">
body{ font-size:10px; }
</style>

正文{字体大小:10px;}

代码将放在html中

不同浏览器的字体大小不同,因为每个浏览器使用不同的基线作为默认大小。您可以选择使用它(因为大多数用户只使用一个浏览器,因此只能看到一个大小版本的站点-如果较大的文本弄乱了布局,这并不好),或者在每个浏览器中将基线字体大小设置为相同


请看一看“”。这是一篇很好的文章,解释了如何让文本在不同的浏览器中显示相同,同时允许用户调整大小。

@Jage-谢谢。但是我有一个问题-我是把它放在标签之间还是直接放在头标签上?此外,当我这样做时,它会将我的标签和输入文本框上移到“关于我”、“联系我们”等的下方。我希望它位于图像下方-有什么想法吗?它将位于head和/head之间的任何位置。此外,将字体大小添加到正文中几乎会影响页面上的每一位文本。您的其他组件可能基于原始字体大小。你可以为那些缩小的链接添加一个样式,以使大小恢复正常。在线快速学习CSS教程,也许在W3学校