gpt4 book ai didi

css - 搜索框 CSS 问题

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

我是新手。我尝试制作一个搜索框。当我在 Firefox 上打开它时。对我来说没关系。然后我在 IE、Chrome 和 Safari 中执行此操作。实际上并不酷。有谁知道我的问题,请帮我解决一下?

我想做一个这样的搜索框:http://www.behance.net/gallery/Anthracite-EIKON/7171451

<div id="search-box">
<input type="text" name="search" placeholder="Search..."/>
</div>

和 CSS:

*{ margin: 0; padding: 0;  }
#search-box{
background: -moz-linear-gradient(top right, #353535, #010101);
background: -webkit-linear-gradient(top right, #353535, #010101);
background: -ms-linear-gradient(top right, #353535, #010101);
background: -o-linear-gradient(top right, #353535, #010101);
background: linear-gradient(top right, #353535, #010101);
padding: 30px 0;
position: relative;
}

input {
font-family: Cambria, 'Helvetica Neue',​Helvetica,​Arial,​sans-serif;
font-size: 14px;
font-style: normal;
font-variant: normal;
color: #bebebe;
font-weight: 400;
line-height: 56px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5) ;

border-radius: 13px;
border: 1px solid #000000;
background-clip: border-box;
padding: 5px 4px 3px 24px;
width: 94px;
height: 27px;
box-shadow: 0 0 9px #121212 inset;
position: absolute;
right: 25px;
top: 15;

background-color: #444444 ;
background-image: url('images/search_icon.png');
background-repeat: no-repeat;
background-size: 12px 12px;
background-position: 9px 8px;
}

input:hover {
box-shadow: none;
}

input:focus {
width: 200px;
box-shadow: none;
text-shadow: none;
color: #4D4E52;
background-color: white ;
background-image: url('images/search_icon5.png');
background-repeat: no-repeat;
background-position: 9px 8px;
}

最佳答案

在您的 input 的 css 中,您需要将 top:15 更改为 top:15px 并将 line-height 更改为 24px;

示例:http://jsfiddle.net/justincook/sMG3R/

关于css - 搜索框 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16631170/

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