gpt4 book ai didi

html - 换行符在 IE 和 Chrome 中呈现不同

转载 作者:行者123 更新时间:2023-11-28 14:32:42 28 4
gpt4 key购买 nike

我正在使用 960 CSS 网格系统。我正在制作一个非常快速的网站模型,并注意到我的换行符在 chrome 中的呈现方式与在 IE8 中的呈现方式截然不同。

以下链接有两个浏览器的屏幕截图。第一张图片是 IE8,第二张图片是 Chrome:http://imgur.com/YLgcsl&kIeTn

我能做些什么来消除我的代码中的不一致

这是我正在使用的代码。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>The 1Kb Grid Demo – 16 columns, 60 pixels each, with 20 pixel gutter</title>
<link href="grid.css" type="text/css" rel="stylesheet" media="screen"/>

<style type="text/css" media="screen">

body { margin: 20px 0 0 0; }
p {
font:60px/100px Helvetica;
color: #000;
text-align: center;
border: 1px solid #000;
margin: 0 0 20px 0;
}

label {
float:left;
}


</style>

</head>
<body>

<div class="row">
<div class="column grid_16"><p>16</p></div>
</div>

<div class="row">
<div class="column grid_8">

<label>First name: </label><br /> <input type="text" name="firstname" /><br />
<label>Last name: </label><br /> <input type="text" name="lastname" /><br />
<label>ID: </label><br /> <input type="text" name="employnum"/>
<br />


<label>Observer</label><br />
<select style="width:150px" name="observer">
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>

</select>

<label>Observed</label>
<form action="">
<select style="width:150px" name="observed">
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>
<option value="other">Other</option>
</select><br />


<label>Operation Code</label><br />
<select style="width:150px" name="opcode">
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>
<option value="TEST"> TEST </option>




</select>

<label>Center</label><br /><br />
<select style="width:150px" name="cost">

<option value="Zone 1"> Zone 1 </option>
<option value="Zone 2"> Zone 2 </option>
<option value="Zone 3"> Zone 3 </option>
</select>
</form>
<div class="row">
<div class="column grid_4"><p>4</p></div>
<div class="column grid_4"><p>4</p></div>
</div>
</div>
<div class="column grid_8"><p style="line-height: 222px;">8</p></div>
</div>

</body>
</html>

最佳答案

使用CSS reset .

浏览器(通常是用户代理)在 HTML 元素上应用预定义的样式。要取消那些预定义的样式,我们鼓励设计人员和开发人员使用重置。

关于html - 换行符在 IE 和 Chrome 中呈现不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7148117/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com