gpt4 book ai didi

html - 如果在 JSFiddle 中显示,IE9 显示相同代码的不同结果

转载 作者:太空宇宙 更新时间:2023-11-04 04:25:44 24 4
gpt4 key购买 nike

以下 fiddle 在 IE 9 中看起来不错,由于框大小调整,字段的填充和边框从宽度中减去:边框框。但是,如果我显示与普通 html 站点完全相同的代码,填充和边框将添加到宽度,使字段大于容器。

知道这里的问题是什么吗?

这是在 ie9 中看起来不错的 fiddle :http://jsfiddle.net/GgwNs/1/

这里是相同的代码,显示为 html 站点时看起来不太好:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>

<style type='text/css'>
.container
{
width: 300px;
height: 30px;
border: thin solid red;
margin-bottom:60px;
}
.content
{
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
padding: 0 20px;
border: 5px solid #000
}
</style>

</head>
<body>
<div class="container">
<input class="content" id="Text1" type="text" />
</div>

</body>

</html>

谢谢

最佳答案

确保您使用适当的元标记设置标准:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

关于html - 如果在 JSFiddle 中显示,IE9 显示相同代码的不同结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18316987/

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