gpt4 book ai didi

css - p标签和输入标签之间有一个像素的差距

转载 作者:行者123 更新时间:2023-11-28 19:10:01 25 4
gpt4 key购买 nike

为什么在 IE6 和 IE7 中的以下代码中 p 标签的顶部和底部之间有一个像素的间隙,而在 Firefox 或 IE8 中却没有?我一直在努力尝试在 powerset website 上创建搜索文本框有趣的是,他们没有 IE6 或 IE7 中的错误。我做错了什么?

  <!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>
<title></title>
<style type="text/css">
#sbox
{
overflow: hidden;
}
#sbox p
{
/*border:1px solid #dae7fa; */
float:left;
display: block;
border: 1px solid red;
width: 208px;
padding: 0;
}
input#q
{
font-size: 11px;
padding: 3px;
border: 1px solid blue;
width: 200px;
color: #999999;
}
</style>
</head>
<body>
<div id="sbox">
<p>
<input id="q" type="text" value="Search..." />
</p>
</div>
</body>
</html>

最佳答案

float:left; 添加到输入#q。这将导致崩溃 p 并消除差距。

关于css - p标签和输入标签之间有一个像素的差距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/983529/

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