gpt4 book ai didi

html - Google Chrome 下的 CSS 问题(文本框和按钮)

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

我对文本框和按钮的定位有疑问,在 Chrome 下无法正确显示。

这是来自每个浏览器的示例,您可以看到 Chrome 下的文本框被推到了不合适的位置。

Internet Explorer/火狐

Internet Explorer

Chrome

Chrome1

html:

<div id="divSearch">
<input type="text" id="txtSearch" placeholder=" Search..."/>
<input type="submit" id="btnSearch" value=""/>
</div>`

CSS:

input[type=text]{
width: 200px;
height: 24px;
border: none;
border-radius: 3px 0px 0px 3px;
-webkit-border-radius: 3px 0px 0px 3px;
-webkit-appearance: none;
-moz-appearance: none;
padding: 0;
}

input[type="submit"]{
border: none;
border-radius: 0px 3px 3px 0px;
-webkit-appearance: none;
-moz-appearance: none;
-webkit-border-radius: 0px 3px 3px 0px;
width: 32px;
height: 24px;
background: url(../img/search_button.png) no-repeat;
background-color: white;
background-position: 10px 5px;
}

#divSearch{
float: right;
width: 300px;
height: 40px;
white-space: nowrap;
margin-right: 50px;
}

现在,如果我从 input[type="submit"] 中删除高度,定位就可以了,只是按钮现在的尺寸不对。

Chrome2

我不明白为什么按钮的高度会导致问题。关于如何修复它有什么建议吗?

谢谢

最佳答案

添加以下代码。它应该工作:

input[type=text]{
float:left
}

关于html - Google Chrome 下的 CSS 问题(文本框和按钮),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36638981/

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